auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setUpMocks ( ) { changeId = Change.Id.parse ( java.lang.Integer.toString ( com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandlerTest.CHANGE_ID ) ) ; accountId = Account.Id.parse ( java.lang.Integer.toString ( com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandlerTest.ACCOUNT_ID ) ) ; indexEventHandler = new com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandler ( com.google.common.util.concurrent.MoreExecutors.directExecutor ( ) , com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandlerTest.PLUGIN_NAME , forwarder ) ; }

Target:
public void setUpMocks ( ) { changeId = Change.Id.parse ( java.lang.Integer.toString ( com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandlerTest.CHANGE_ID ) ) ; accountId = Account.Id.parse ( java.lang.Integer.toString ( com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandlerTest.ACCOUNT_ID ) ) ; accountGroupUUID = AccountGroup.UUID.parse ( com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandlerTest.UUID ) ; indexEventHandler = new com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandler ( com.google.common.util.concurrent.MoreExecutors.directExecutor ( ) , com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandlerTest.PLUGIN_NAME , forwarder ) ; }
Source:
public void isEnabledForMultipleRefs ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig config = getConfig ( ( "[plugin \"uploadvalidator\"]\n" + ( ( " ref = refs/heads/branch1\n" + " ref = refs/heads/branch2\n" ) + " blockedFileExtension = jar" ) ) ) ; assertThat ( config.isEnabledForRef ( projectName , "refs/heads/branch1" ) ) . isTrue ( ) ; assertThat ( config.isEnabledForRef ( projectName , "refs/heads/branch2" ) ) . isTrue ( ) ; assertThat ( config.isEnabledForRef ( projectName , "refs/heads/branch3" ) ) . isFalse ( ) ; }

Target:
public void isEnabledForRegexRef ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig config = getConfig ( ( "[plugin \"uploadvalidator\"]\n" + ( " ref = ^refs/heads/mybranch.*\n" + " blockedFileExtension = jar" ) ) ) ; com.google.common.truth.Truth.assertThat ( config.isEnabledForRef ( projectName , "refs/heads/anotherref" , "blockedFileExtension" ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( config.isEnabledForRef ( projectName , "refs/heads/mybranch123" , "blockedFileExtension" ) ) . isTrue ( ) ; }
Source:
public java.util.Collection < com.google.gerrit.common.data.AccessSection > getAccessSections ( ) { return accessSections.values ( ) ; }

Target:
public void replace ( com.google.gerrit.common.data.AccessSection section ) { for ( com.google.gerrit.common.data.Permission permission : section.getPermissions ( ) ) { for ( com.google.gerrit.common.data.PermissionRule rule : permission.getRules ( ) ) { rule.setGroup ( resolve ( rule.getGroup ( ) ) ) ; } } accessSections.put ( section.getRefPattern ( ) , section ) ; }
Source:
public void tearDown ( ) { if ( ( lifecycle ) != null ) { lifecycle.stop ( ) ; } requestContext.setContext ( null ) ; if ( ( db ) != null ) { db.close ( ) ; } com.google.gerrit.testutil.InMemoryDatabase.drop ( schemaFactory ) ; }

Target:
public void tearDown ( ) { if ( ( lifecycle ) != null ) { lifecycle.stop ( ) ; } requestContext.setContext ( null ) ; if ( ( db ) != null ) { db.close ( ) ; } com.google.gerrit.testing.InMemoryDatabase.drop ( schemaFactory ) ; }
Source:
public void onClick ( com.google.gwt.user.client.ui.Widget sender ) { final boolean oldValue = k.isGroupOwner ( ) ; final boolean newValue = owner.isChecked ( ) ; Util.GROUP_SVC.changeGroupOwner ( k.getKey ( ) , newValue , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { k.setGroupOwner ( newValue ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { owner.setChecked ( oldValue ) ; k.setGroupOwner ( oldValue ) ; super . onFailure ( caught ) ; } } ) ; }

Target:
public void onClick ( com.google.gwt.user.client.ui.Widget sender ) { final java.lang.String newOwner = ownerTxt.getText ( ) . trim ( ) ; if ( ( newOwner.length ( ) ) > 0 ) { Util.GROUP_SVC.changeGroupOwner ( groupId , newOwner , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { saveOwner.setEnabled ( false ) ; } } ) ; } }
Source:
private void display ( final com.google.gerrit.client.projects.ProjectMap result ) { projects.display ( result ) ; projects.finishDisplay ( ) ; }

Target:
protected void preDisplay ( final com.google.gerrit.client.projects.ProjectMap result ) { if ( ( ( mySubname == null ) && ( ( subname ) == null ) ) || ( ( mySubname != null ) && ( mySubname.equals ( subname ) ) ) ) { projects.display ( result ) ; } }
Source:
public com.google.gerrit.server.IdentifiedUser parse ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.UnprocessableEntityException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.IdentifiedUser user = parseId ( id ) ; if ( user == null ) { throw new com.google.gerrit.extensions.restapi.UnprocessableEntityException ( java.lang.String.format ( "Account Not Found: %s" , id ) ) ; } return user ; }

Target:
public com.google.gerrit.server.IdentifiedUser parse ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.UnprocessableEntityException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.IdentifiedUser user = parseId ( id ) ; if ( user == null ) { throw new com.google.gerrit.extensions.restapi.UnprocessableEntityException ( java.lang.String.format ( "Account Not Found: %s" , id ) ) ; } else if ( ! ( accountControlFactory.get ( ) . canSee ( user.getAccount ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.UnprocessableEntityException ( java.lang.String.format ( "Account Not Found: %s" , id ) ) ; } return user ; }
Source:
public boolean isOwner ( ) { com.google.gerrit.reviewdb.client.AccountGroup accountGroup = com.google.gerrit.common.data.GroupDescriptions.toAccountGroup ( group ) ; if ( accountGroup == null ) { isOwner = false ; } else if ( ( isOwner ) == null ) { com.google.gerrit.reviewdb.client.AccountGroup.UUID ownerUUID = accountGroup.getOwnerGroupUUID ( ) ; isOwner = ( getCurrentUser ( ) . getEffectiveGroups ( ) . contains ( ownerUUID ) ) || ( getCurrentUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ; } return isOwner ; }

Target:
public boolean isOwner ( ) { com.google.gerrit.reviewdb.client.AccountGroup accountGroup = com.google.gerrit.common.data.GroupDescriptions.toAccountGroup ( group ) ; if ( accountGroup == null ) { isOwner = false ; } else if ( ( isOwner ) == null ) { com.google.gerrit.reviewdb.client.AccountGroup.UUID ownerUUID = accountGroup.getOwnerGroupUUID ( ) ; isOwner = ( getCurrentUser ( ) . memberOf ( ownerUUID ) ) || ( getCurrentUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ; } return isOwner ; }
Source:
private boolean isChunk ( final int row ) { final java.lang.Object o = getRowItem ( row ) ; if ( o instanceof com.google.gerrit.client.patches.PatchLine ) { final com.google.gerrit.client.patches.PatchLine pl = ( ( com.google.gerrit.client.patches.PatchLine ) ( o ) ) ; switch ( pl.getType ( ) ) { case DELETE : case INSERT : case REPLACE : return true ; } } else if ( o instanceof com.google.gerrit.client.patches.AbstractPatchContentTable.CommentList ) { return true ; } return false ; }

Target:
private boolean isChunk ( final int row ) { final java.lang.Object o = getRowItem ( row ) ; if ( ( ! ( onlyOneHunk ) ) && ( o instanceof com.google.gerrit.client.patches.PatchLine ) ) { final com.google.gerrit.client.patches.PatchLine pl = ( ( com.google.gerrit.client.patches.PatchLine ) ( o ) ) ; switch ( pl.getType ( ) ) { case DELETE : case INSERT : case REPLACE : return true ; } } else if ( o instanceof com.google.gerrit.client.patches.AbstractPatchContentTable.CommentList ) { return true ; } return false ; }
Source:
private void displayDefaultContext ( final short lines ) { for ( int i = 0 ; i < ( AccountGeneralPreferences.CONTEXT_CHOICES.length ) ; i ++ ) { if ( ( com.google.gerrit.client.reviewdb.AccountGeneralPreferences.CONTEXT_CHOICES [ i ] ) == lines ) { defaultContext.setSelectedIndex ( i ) ; return ; } } displayDefaultContext ( AccountGeneralPreferences.DEFAULT_CONTEXT ) ; }

Target:
private void enable ( final boolean on ) { showSiteHeader.setEnabled ( on ) ; useFlashClipboard.setEnabled ( on ) ; maximumPageSize.setEnabled ( on ) ; defaultContext.setEnabled ( on ) ; }
Source:
private static void publish ( final com.google.gerrit.reviewdb.client.PatchSet.Id ps ) { java.lang.String token = com.google.gerrit.client.Dispatcher.toPublish ( ps ) ; new com.google.gerrit.client.Dispatcher.AsyncSplit ( token ) { public void onSuccess ( ) { com.google.gerrit.client.Gerrit.display ( token , select ( ) ) ; } private com.google.gerrit.client.ui.Screen select ( ) { return new com.google.gerrit.client.changes.PublishCommentScreen ( ps ) ; } } . onSuccess ( ) ; }

Target:
private static PatchSet.Id toPsId ( com.google.gerrit.reviewdb.client.Change.Id id , java.lang.String psIdStr ) { return new com.google.gerrit.reviewdb.client.PatchSet.Id ( id , ( psIdStr.equals ( "edit" ) ? 0 : java.lang.Integer.parseInt ( psIdStr ) ) ) ; }
Source:
private static boolean havePGP ( ) { try { java.lang.Class.forName ( org.bouncycastle.openpgp.PGPPublicKey.class . getName ( ) ) ; return true ; } catch ( java.lang.NoClassDefFoundError noBouncyCastle ) { return false ; } catch ( java.lang.ClassNotFoundException noBouncyCastle ) { return false ; } }

Target:
private static boolean havePGP ( ) { try { java.lang.Class.forName ( org.bouncycastle.openpgp.PGPPublicKey.class . getName ( ) ) ; java.security.Security.addProvider ( new org.bouncycastle.jce.provider.BouncyCastleProvider ( ) ) ; return true ; } catch ( java.lang.NoClassDefFoundError noBouncyCastle ) { return false ; } catch ( java.lang.ClassNotFoundException noBouncyCastle ) { return false ; } }
Source:
public void execute ( ) { com.google.gwt.user.client.Window.scrollTo ( 0 , 0 ) ; for ( int i = 0 ; i < ( labelsTable.getColumnCount ( ) ) ; i ++ ) { com.google.gwt.user.client.ui.RadioButton b = ( ( com.google.gwt.user.client.ui.RadioButton ) ( labelsTable.getWidget ( 1 , i ) ) ) ; if ( ( b != null ) && ( b.getValue ( ) ) ) { b.setFocus ( true ) ; break ; } } }

Target:
public void onFailure ( java.lang.Throwable caught ) { send.setEnabled ( true ) ; }
Source:
private void parseDelete ( final org.eclipse.jgit.transport.ReceiveCommand cmd ) { com.google.gerrit.server.project.RefControl ctl = projectControl.controlForRef ( cmd.getRefName ( ) ) ; if ( ctl.canDelete ( ) ) { } else { com.google.gerrit.server.git.ReceiveCommits.reject ( cmd , "can not delete references" ) ; } }

Target:
private void parseDelete ( final org.eclipse.jgit.transport.ReceiveCommand cmd ) { com.google.gerrit.server.project.RefControl ctl = projectControl.controlForRef ( cmd.getRefName ( ) ) ; if ( ctl.canDelete ( ) ) { batch.addCommand ( cmd ) ; } else { if ( GitRepositoryManager.REF_CONFIG.equals ( ctl.getRefName ( ) ) ) { reject ( cmd , "cannot delete project configuration" ) ; } else { errors.put ( com.google.gerrit.server.git.ReceiveCommits.Error.DELETE , ctl.getRefName ( ) ) ; reject ( cmd , "cannot delete references" ) ; } } }
Source:
public void unblockInLocalForceEditTopicName_Fails ( ) { com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; com.google.common.truth.Truth.assertThat ( u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) . named ( "u can't edit topic name" ) . isFalse ( ) ; }

Target:
public void unblockInLocalForceEditTopicName_Fails ( ) { com.google.gerrit.server.project.testing.Util.block ( parent , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.testing.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; com.google.common.truth.Truth.assertThat ( u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) . named ( "u can't edit topic name" ) . isFalse ( ) ; }
Source:
protected void configure ( ) { bind ( org.apache.http.impl.client.CloseableHttpClient.class ) . toProvider ( com.ericsson.gerrit.plugins.syncindex.HttpClientProvider.class ) . in ( Scopes.SINGLETON ) ; bind ( com.ericsson.gerrit.plugins.syncindex.Configuration.class ) . in ( Scopes.SINGLETON ) ; bind ( com.ericsson.gerrit.plugins.syncindex.HttpSession.class ) ; bind ( com.ericsson.gerrit.plugins.syncindex.RestSession.class ) ; bind ( java.util.concurrent.Executor.class ) . annotatedWith ( com.ericsson.gerrit.plugins.syncindex.SyncIndexExecutor.class ) . toProvider ( com.ericsson.gerrit.plugins.syncindex.SyncIndexExecutorProvider.class ) ; listener ( ) . to ( com.ericsson.gerrit.plugins.syncindex.SyncIndexExecutorProvider.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.extensions.events.ChangeIndexedListener.class ) . to ( com.ericsson.gerrit.plugins.syncindex.IndexEventHandler.class ) ; }

Target:
protected void configure ( ) { bind ( org.apache.http.impl.client.CloseableHttpClient.class ) . toProvider ( com.ericsson.gerrit.plugins.syncindex.HttpClientProvider.class ) . in ( Scopes.SINGLETON ) ; bind ( com.ericsson.gerrit.plugins.syncindex.Configuration.class ) . in ( Scopes.SINGLETON ) ; bind ( com.ericsson.gerrit.plugins.syncindex.HttpSession.class ) ; bind ( com.ericsson.gerrit.plugins.syncindex.RestSession.class ) ; bind ( java.util.concurrent.Executor.class ) . annotatedWith ( com.ericsson.gerrit.plugins.syncindex.SyncIndexExecutor.class ) . toProvider ( com.ericsson.gerrit.plugins.syncindex.SyncIndexExecutorProvider.class ) ; listener ( ) . to ( com.ericsson.gerrit.plugins.syncindex.SyncIndexExecutorProvider.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.ChangeIndexedListener.class ) . to ( com.ericsson.gerrit.plugins.syncindex.IndexEventHandler.class ) ; }
Source:
public void offlineUponStart ( ) throws java.lang.Exception { setUpClientMock ( ) ; org.mockito.Mockito.doThrow ( new java.sql.SQLException ( new java.net.ConnectException ( ) ) ) . when ( eventsDb ) . createDBIfNotCreated ( ) ; org.mockito.Mockito.doThrow ( new java.sql.SQLException ( ) ) . when ( eventsDb ) . queryOne ( ) ; }

Target:
public void offlineUponStart ( ) throws java.lang.Exception { setUpClientMock ( ) ; org.mockito.Mockito.doThrow ( new java.sql.SQLException ( new java.net.ConnectException ( ) ) ) . when ( eventsDb ) . createDBIfNotCreated ( ) ; org.mockito.Mockito.doThrow ( new java.sql.SQLException ( ) ) . when ( eventsDb ) . queryOne ( ) ; store = new com.ericsson.gerrit.plugins.eventslog.sql.SQLStore ( userProviderMock , cfgMock , eventsDb , localEventsDb , poolMock , permissionBackendMock ) ; store.start ( ) ; org.mockito.Mockito.verify ( localEventsDb ) . createDBIfNotCreated ( ) ; }
Source:
public static void dialog ( final com.google.gwt.user.client.ui.PopupPanel panel ) { com.google.gwtexpui.globalkey.client.GlobalKey.initEvents ( ) ; com.google.gwtexpui.globalkey.client.GlobalKey.initDialog ( ) ; assert panel.isShowing ( ) ; assert ( com.google.gwtexpui.globalkey.client.GlobalKey.active ) == ( com.google.gwtexpui.globalkey.client.GlobalKey.global ) ; com.google.gwtexpui.globalkey.client.GlobalKey.active = new com.google.gwtexpui.globalkey.client.GlobalKey.State ( panel ) ; com.google.gwtexpui.globalkey.client.GlobalKey.active.add ( new com.google.gwtexpui.globalkey.client.HidePopupPanelCommand ( 0 , com.google.gwt.event.dom.client.KeyCodes.KEY_ESCAPE , panel ) ) ; panel.addCloseHandler ( com.google.gwtexpui.globalkey.client.GlobalKey.restoreGlobal ) ; }

Target:
public void onKeyDown ( com.google.gwt.event.dom.client.KeyDownEvent event ) { if ( ( event.getNativeKeyCode ( ) ) == ( com.google.gwt.event.dom.client.KeyCodes.KEY_ESCAPE ) ) { panel.hide ( ) ; } }
Source:
private void setDoubleClickHandler ( ) { if ( ( messageClick ) == null ) { messageClick = contentPanelMessage.addDomHandler ( new com.google.gwt.event.dom.client.DoubleClickHandler ( ) { @ java.lang.Override public void onDoubleClick ( com.google.gwt.event.dom.client.DoubleClickEvent arg0 ) { editArea.setText ( contentPanelMessage.getText ( ) ) ; setEdit ( ( ! ( isEdit ( ) ) ) ) ; runClickCallback ( ) ; } } , com.google.gwt.event.dom.client.DoubleClickEvent.getType ( ) ) ; } }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; messageClick = contentPanelMessage.addDoubleClickHandler ( new com.google.gwt.event.dom.client.DoubleClickHandler ( ) { @ java.lang.Override public void onDoubleClick ( com.google.gwt.event.dom.client.DoubleClickEvent arg0 ) { setEdit ( true ) ; } } ) ; addDomHandler ( new com.google.gwt.event.dom.client.MouseMoveHandler ( ) { @ java.lang.Override public void onMouseMove ( com.google.gwt.event.dom.client.MouseMoveEvent arg0 ) { resizePaddingWidget ( ) ; } } , com.google.gwt.event.dom.client.MouseMoveEvent.getType ( ) ) ; }
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 ( ) { prefsAction.show ( ) ; }
Source:
public void setHttpInjector ( com.google.inject.Injector injector ) { httpModule = com.google.gerrit.server.plugins.PluginGuiceEnvironment.copy ( injector ) ; httpGen = injector.getProvider ( com.google.gerrit.server.plugins.ModuleGenerator.class ) ; onStart.addAll ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.listeners ( injector , com.google.gerrit.server.plugins.StartPluginListener.class ) ) ; onReload.addAll ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.listeners ( injector , com.google.gerrit.server.plugins.ReloadPluginListener.class ) ) ; }

Target:
public void setHttpInjector ( com.google.inject.Injector injector ) { httpModule = com.google.gerrit.server.plugins.PluginGuiceEnvironment.copy ( injector ) ; httpGen = injector.getProvider ( com.google.gerrit.server.plugins.ModuleGenerator.class ) ; httpSets = com.google.gerrit.server.plugins.PluginGuiceEnvironment.dynamicSetsOf ( injector ) ; httpMaps = com.google.gerrit.server.plugins.PluginGuiceEnvironment.dynamicMapsOf ( injector ) ; onStart.addAll ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.listeners ( injector , com.google.gerrit.server.plugins.StartPluginListener.class ) ) ; onReload.addAll ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.listeners ( injector , com.google.gerrit.server.plugins.ReloadPluginListener.class ) ) ; }
Source:
public void abandonWipChangeInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; abandon ( sc.changeId , sc.owner ) ; assertThat ( sender ) . notSent ( ) ; }

Target:
public void abandonWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; abandon ( sc.changeId , sc.owner ) ; assertThat ( sender ) . notSent ( ) ; }
Source:
private void setReviewed ( com.google.gerrit.client.info.FileInfo info , boolean r ) { com.google.gerrit.client.rpc.RestApi api = com.google.gerrit.client.changes.ChangeApi.revision ( curr ) . view ( "files" ) . id ( info.path ( ) ) . view ( "reviewed" ) ; if ( r ) { api.put ( com.google.gerrit.client.rpc.CallbackGroup.< com.google.gerrit.client.changes.ReviewInfo > emptyCallback ( ) ) ; } else { api.delete ( com.google.gerrit.client.rpc.CallbackGroup.< com.google.gerrit.client.changes.ReviewInfo > emptyCallback ( ) ) ; } }

Target:
private java.lang.String url ( com.google.gerrit.client.info.FileInfo info ) { return info.binary ( ) ? com.google.gerrit.client.Dispatcher.toUnified ( project , base , curr , info.path ( ) ) : ( mode ) == ( com.google.gerrit.client.change.FileTable.Mode.REVIEW ) ? com.google.gerrit.client.Dispatcher.toPatch ( project , base , curr , info.path ( ) ) : com.google.gerrit.client.Dispatcher.toEditScreen ( project , curr , info.path ( ) ) ; }
Source:
public java.util.List < com.google.gerrit.server.ReviewerStatusUpdate > reviewerUpdates ( ) throws com.google.gwtorm.server.OrmException { if ( ( reviewerUpdates ) == null ) { reviewerUpdates = approvalsUtil.getReviewerUpdates ( notes ( ) ) ; } return reviewerUpdates ; }

Target:
public java.util.List < com.google.gerrit.server.ReviewerStatusUpdate > reviewerUpdates ( ) throws com.google.gwtorm.server.OrmException { if ( ( reviewerUpdates ) == null ) { if ( ! ( lazyLoad ) ) { return java.util.Collections.emptyList ( ) ; } reviewerUpdates = approvalsUtil.getReviewerUpdates ( notes ( ) ) ; } return reviewerUpdates ; }
Source:
public static boolean isExpected ( int statusCode ) { switch ( statusCode ) { case com.google.gerrit.client.rpc.RestApi.SC_UNAVAILABLE : case 400 : case 401 : case 403 : case 404 : case 405 : case 409 : case 412 : case 429 : return true ; default : return false ; } }

Target:
public static boolean isExpected ( int statusCode ) { switch ( statusCode ) { case com.google.gerrit.client.rpc.RestApi.SC_UNAVAILABLE : case 400 : case 401 : case 403 : case 404 : case 405 : case 409 : case 412 : case 422 : case 429 : return true ; default : return false ; } }
Source:
private static boolean isSingleQuery ( java.lang.String query ) { if ( query.matches ( "^[1-9][0-9]*$" ) ) { return true ; } if ( query.matches ( "^[iI][0-9a-f]{4,}$" ) ) { return true ; } if ( query.matches ( ( ( "^([0-9a-fA-F]{4," + ( com.google.gerrit.reviewdb.client.RevId.LEN ) ) + "})$" ) ) ) { return true ; } return false ; }

Target:
private static boolean isSingleQuery ( java.lang.String query ) { return ( ( com.google.gerrit.client.changes.QueryScreen.NUMERIC_ID.test ( query ) ) || ( com.google.gerrit.client.changes.QueryScreen.CHANGE_ID.test ( query ) ) ) || ( com.google.gerrit.client.changes.QueryScreen.COMMIT_SHA1.test ( query ) ) ; }
Source:
public void storeLocalOffline ( ) throws java.lang.Exception { setUpClientMock ( ) ; org.mockito.Mockito.doThrow ( new java.sql.SQLException ( new java.net.ConnectException ( ) ) ) . when ( eventsDb ) . createDBIfNotCreated ( ) ; org.mockito.Mockito.doThrow ( new java.sql.SQLException ( ) ) . when ( eventsDb ) . queryOne ( ) ; }

Target:
public void throwSQLExceptionIfNotOnline ( ) throws java.lang.Exception { setUpClientMock ( ) ; org.mockito.Mockito.doThrow ( new java.sql.SQLException ( new java.net.ConnectException ( ) ) ) . when ( eventsDb ) . createDBIfNotCreated ( ) ; org.mockito.Mockito.doThrow ( new java.sql.SQLException ( ) ) . when ( eventsDb ) . queryOne ( ) ; store = new com.ericsson.gerrit.plugins.eventslog.sql.SQLStore ( userProviderMock , cfgMock , eventsDb , localEventsDb , poolMock , permissionBackendMock ) ; store.start ( ) ; store.storeEvent ( mockEvent ) ; store.queryChangeEvents ( com.ericsson.gerrit.plugins.eventslog.sql.SQLStoreTest.GENERIC_QUERY ) ; }
Source:
private boolean validateAction ( java.lang.String actionName , java.lang.String actionValue ) throws com.j2bugzilla.base.BugzillaException { com.j2bugzilla.rpc.GetLegalValues.Fields field = getFields ( ) . get ( actionName ) ; return ( field != null ) && ( getLegalValues ( field ) . contains ( actionValue ) ) ; }

Target:
public void performAction ( final java.lang.String bugId , final java.lang.String actionName , final java.lang.String actionValue ) throws com.googlesource.gerrit.plugins.hooks.its.InvalidTransitionException , com.j2bugzilla.base.BugzillaException { com.j2bugzilla.base.Bug bug = getBug ( bugId ) ; if ( ( "status" . equals ( actionName ) ) || ( "resolution" . equals ( actionName ) ) ) { performSimpleActionChainable ( bug , actionName , actionValue ) ; } else { throw new com.googlesource.gerrit.plugins.hooks.its.InvalidTransitionException ( ( ( ( "Action " + actionName ) + " is not" ) + " known" ) ) ; } connector.executeMethod ( new com.j2bugzilla.rpc.UpdateBug ( bug ) ) ; }
Source:
void setShowLineNumbers ( boolean b ) { cmA.setOption ( "lineNumbers" , b ) ; cmB.setOption ( "lineNumbers" , b ) ; if ( b ) { diffTable.addStyleName ( DiffTable.style.showLineNumbers ( ) ) ; } else { diffTable.removeStyleName ( DiffTable.style.showLineNumbers ( ) ) ; } }

Target:
public void run ( ) { if ( ( cm.hasActiveLine ( ) ) && ( ( toLeft && ( cm == ( cmB ) ) ) || ( ( ! toLeft ) && ( cm == ( cmA ) ) ) ) ) { net.codemirror.lib.CodeMirror other = otherCm ( cm ) ; other.setCursor ( net.codemirror.lib.LineCharacter.create ( mapper.lineOnOther ( getSideFromCm ( cm ) , cm.getLineNumber ( cm.getActiveLine ( ) ) ) . getLine ( ) ) ) ; other.focus ( ) ; } }
Source:
public org.eclipse.jgit.lib.ObjectId loadRevision ( ) throws com.google.gwtorm.server.OrmException { if ( loaded ) { return getRevision ( ) ; } else if ( ! ( args.migration.enabled ( ) ) ) { return null ; } try ( org.eclipse.jgit.lib.Repository repo = args.repoManager.openRepository ( getProjectName ( ) ) ) { org.eclipse.jgit.lib.Ref ref = repo.getRefDatabase ( ) . exactRef ( getRefName ( ) ) ; return ref != null ? ref.getObjectId ( ) : null ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }

Target:
public org.eclipse.jgit.lib.ObjectId loadRevision ( ) throws com.google.gwtorm.server.OrmException { if ( loaded ) { return getRevision ( ) ; } else if ( ! ( args.migration.readChanges ( ) ) ) { return null ; } try ( org.eclipse.jgit.lib.Repository repo = args.repoManager.openRepository ( getProjectName ( ) ) ) { org.eclipse.jgit.lib.Ref ref = repo.getRefDatabase ( ) . exactRef ( getRefName ( ) ) ; return ref != null ? ref.getObjectId ( ) : null ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }
Source:
private com.google.gerrit.server.git.ProjectLevelConfig getPluginConfig ( com.google.gerrit.reviewdb.client.Project.NameKey projectName , java.lang.String pluginName ) throws com.google.gerrit.server.project.NoSuchProjectException { com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( projectName ) ; if ( projectState == null ) { throw new com.google.gerrit.server.project.NoSuchProjectException ( projectName ) ; } return projectState.getConfig ( pluginName ) ; }

Target:
private com.google.gerrit.server.git.ProjectLevelConfig getPluginConfig ( com.google.gerrit.reviewdb.client.Project.NameKey projectName , java.lang.String pluginName ) throws com.google.gerrit.server.project.NoSuchProjectException { com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( projectName ) ; if ( projectState == null ) { throw new com.google.gerrit.server.project.NoSuchProjectException ( projectName ) ; } return projectState.getConfig ( ( pluginName + ( com.google.gerrit.server.config.PluginConfigFactory.EXTENSION ) ) ) ; }
Source:
private void assertProblems ( org.eclipse.jgit.transport.PushCertificate cert , java.lang.String ... expected ) throws java.lang.Exception { com.google.gerrit.gpg.CheckResult result = checker.check ( cert ) . getCheckResult ( ) ; org.junit.Assert.assertEquals ( java.util.Arrays.asList ( expected ) , result.getProblems ( ) ) ; }

Target:
private void assertProblems ( org.eclipse.jgit.transport.PushCertificate cert , java.lang.String first , java.lang.String ... rest ) throws java.lang.Exception { java.util.List < java.lang.String > expected = new java.util.ArrayList < > ( ) ; expected.add ( first ) ; expected.addAll ( java.util.Arrays.asList ( rest ) ) ; com.google.gerrit.gpg.CheckResult result = checker.check ( cert ) . getCheckResult ( ) ; org.junit.Assert.assertEquals ( expected , result.getProblems ( ) ) ; }
Source:
public void testReplaceTwoLinks ( ) { final com.google.gwtexpui.safehtml.client.RegexFindReplace [ ] repl = new com.google.gwtexpui.safehtml.client.RegexFindReplace [ ] { new com.google.gwtexpui.safehtml.client.RegexFindReplace ( "(issue\\s(\\d+))" , "<a href=\"?$2\">$1</a>" ) } ; final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.html ( "A\nissue 42\nissue 9918\nB" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.replaceAll ( java.util.Arrays.asList ( repl ) ) ; assertNotSame ( o , n ) ; assertEquals ( ( "A\n" + ( ( "<a href=\"?42\">issue 42</a>\n" + "<a href=\"?9918\">issue 9918</a>\n" ) + "B" ) ) , n.asString ( ) ) ; }

Target:
public void testReplaceTwoLinks ( ) { com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.html ( "A\nissue 42\nissue 9918\nB" ) ; com.google.gwtexpui.safehtml.client.SafeHtml n = o.replaceAll ( com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.repls ( new com.google.gwtexpui.safehtml.client.RawFindReplace ( "(issue\\s(\\d+))" , "<a href=\"?$2\">$1</a>" ) ) ) ; assertNotSame ( o , n ) ; assertEquals ( ( "A\n" + ( ( "<a href=\"?42\">issue 42</a>\n" + "<a href=\"?9918\">issue 9918</a>\n" ) + "B" ) ) , n.asString ( ) ) ; }
Source:
public void abandonReviewableChangeNotifyOwnersReviewers ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; abandon ( sc.changeId , sc.owner , com.google.gerrit.extensions.api.changes.NotifyHandling.OWNER_REVIEWERS ) ; assertThat ( sender ) . sent ( "abandon" , sc ) . notTo ( sc.owner , sc.starrer ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; }

Target:
public void abandonReviewableChangeNotifyOwnersReviewers ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; abandon ( sc.changeId , sc.owner , com.google.gerrit.extensions.api.changes.NotifyHandling.OWNER_REVIEWERS ) ; assertThat ( sender ) . sent ( "abandon" , sc ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . noOneElse ( ) ; }
Source:
public void testUpsertTwoFirstExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 1 , 0 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , 1 ) ; createClassUnderTest ( ) . upsert ( twoRows ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( insert ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertExpectedIdsUsed ( insert , 2 ) ; }

Target:
public void upsertTwoFirstExistsingNoInfo ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE , 1 , 0 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.INSERT , 1 ) ; classUnderTest.upsert ( twoRows ) ; assertCorrectUpdating ( update , 1 , 2 ) ; assertCorrectUpdating ( insert , 2 ) ; }
Source:
public void nonIndexPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "foo:a OR foo:b" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.query.change.AndChangeSource.class ) . isSameAs ( out.getClass ( ) ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( com.google.gerrit.server.query.change.ChangeStatusPredicate.open ( ) ) , in ) . inOrder ( ) ; }

Target:
public void nonIndexPredicates ( ) throws java.lang.Exception { com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "foo:a OR foo:b" ) ; com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.query.change.AndChangeSource.class ) . isSameAs ( out.getClass ( ) ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( com.google.gerrit.server.query.change.ChangeStatusPredicate.open ( ) ) , in ) . inOrder ( ) ; }
Source:
private com.google.gerrit.server.git.MetaDataUpdate createMetaDataUpdate ( org.eclipse.jgit.lib.Repository allUsersRepo , @ com.google.gerrit.common.Nullable org.eclipse.jgit.lib.BatchRefUpdate batchRefUpdate ) { com.google.gerrit.server.git.MetaDataUpdate metaDataUpdate = new com.google.gerrit.server.git.MetaDataUpdate ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.DISABLED , allUsersName , allUsersRepo , batchRefUpdate ) ; metaDataUpdate.getCommitBuilder ( ) . setAuthor ( serverUser ) ; metaDataUpdate.getCommitBuilder ( ) . setCommitter ( serverUser ) ; return metaDataUpdate ; }

Target:
private com.google.gerrit.server.git.meta.MetaDataUpdate createMetaDataUpdate ( org.eclipse.jgit.lib.Repository allUsersRepo , @ com.google.gerrit.common.Nullable org.eclipse.jgit.lib.BatchRefUpdate batchRefUpdate ) { com.google.gerrit.server.git.meta.MetaDataUpdate metaDataUpdate = new com.google.gerrit.server.git.meta.MetaDataUpdate ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.DISABLED , allUsersName , allUsersRepo , batchRefUpdate ) ; metaDataUpdate.getCommitBuilder ( ) . setAuthor ( serverUser ) ; metaDataUpdate.getCommitBuilder ( ) . setCommitter ( serverUser ) ; return metaDataUpdate ; }
Source:
public void testMultipleIndexPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "file:a OR foo:b OR file:c OR foo:d" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; org.junit.Assert.assertSame ( com.google.gerrit.server.query.change.OrSource.class , out.getClass ( ) ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( query ( com.google.gerrit.server.query.Predicate.or ( in.getChild ( 0 ) , in.getChild ( 2 ) ) ) , in.getChild ( 1 ) , in.getChild ( 3 ) ) , out.getChildren ( ) ) ; }

Target:
public void testMultipleIndexPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "file:a OR foo:b OR file:c OR foo:d" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; com.google.common.truth.Truth.assertThat ( out.getClass ( ) ) . isSameAs ( com.google.gerrit.server.query.change.OrSource.class ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( com.google.gerrit.server.query.Predicate.or ( in.getChild ( 0 ) , in.getChild ( 2 ) ) ) , in.getChild ( 1 ) , in.getChild ( 3 ) ) . inOrder ( ) ; }
Source:
protected void configure ( ) { bind ( java.io.File.class ) . annotatedWith ( com.google.gerrit.server.config.SitePath.class ) . toInstance ( getSitePath ( ) ) ; bind ( com.google.gerrit.pgm.init.Browser.class ) ; }

Target:
protected void configure ( ) { bind ( java.io.File.class ) . annotatedWith ( com.google.gerrit.server.config.SitePath.class ) . toInstance ( getSitePath ( ) ) ; bind ( com.google.gerrit.pgm.init.Browser.class ) ; bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.server.securestore.SecureStoreClassName.class ) . toProvider ( com.google.inject.util.Providers.of ( getConfiguredSecureStoreClass ( ) ) ) ; }
Source:
public synchronized void stop ( ) { if ( ( daemonAcceptor ) != null ) { try { daemonAcceptor.close ( true ) . await ( ) ; com.google.gerrit.sshd.SshDaemon.sshDaemonLog.info ( "Stopped Gerrit SSHD" ) ; } catch ( java.io.IOException e ) { com.google.gerrit.sshd.SshDaemon.sshDaemonLog.warn ( "Exception caught while closing" , e ) ; } finally { daemonAcceptor = null ; } } }

Target:
public synchronized void stop ( ) { if ( ( daemonAcceptor ) != null ) { try { daemonAcceptor.close ( true ) . await ( ) ; shutdownExecutors ( ) ; com.google.gerrit.sshd.SshDaemon.sshDaemonLog.info ( "Stopped Gerrit SSHD" ) ; } catch ( java.io.IOException e ) { com.google.gerrit.sshd.SshDaemon.sshDaemonLog.warn ( "Exception caught while closing" , e ) ; } finally { daemonAcceptor = null ; } } }
Source:
private boolean inProject ( com.google.gerrit.reviewdb.client.Project project ) { if ( ( projectControl ) != null ) { return projectControl.getProject ( ) . getNameKey ( ) . equals ( project.getNameKey ( ) ) ; } else { return true ; } }

Target:
void addChange ( java.lang.String token ) { try { changeArgumentParser.addChange ( token , changes , projectControl ) ; } catch ( com.google.gerrit.sshd.commands.UnloggedFailure e ) { throw new java.lang.IllegalArgumentException ( e.getMessage ( ) , e ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalArgumentException ( "database is down" , e ) ; } }
Source:
public com.google.gerrit.server.git.PluginProjectConfig getPluginConfig ( java.lang.String pluginName ) { com.google.common.collect.LinkedListMultimap < java.lang.String , java.lang.String > pluginConfig = pluginConfigs.get ( pluginName ) ; if ( pluginConfig == null ) { pluginConfig = com.google.common.collect.LinkedListMultimap.create ( ) ; pluginConfigs.put ( pluginName , pluginConfig ) ; } return new com.google.gerrit.server.git.PluginProjectConfig ( pluginName , pluginConfig ) ; }

Target:
private void loadPluginSections ( org.eclipse.jgit.lib.Config rc ) { pluginConfigs = com.google.common.collect.Maps.newHashMap ( ) ; for ( java.lang.String plugin : rc.getSubsections ( com.google.gerrit.server.git.ProjectConfig.PLUGIN ) ) { org.eclipse.jgit.lib.Config pluginConfig = new org.eclipse.jgit.lib.Config ( ) ; pluginConfigs.put ( plugin , pluginConfig ) ; for ( java.lang.String name : rc.getNames ( com.google.gerrit.server.git.ProjectConfig.PLUGIN , plugin ) ) { pluginConfig.setStringList ( com.google.gerrit.server.git.ProjectConfig.PLUGIN , plugin , name , java.util.Arrays.asList ( rc.getStringList ( com.google.gerrit.server.git.ProjectConfig.PLUGIN , plugin , name ) ) ) ; } } }
Source:
protected void run ( ) throws java.lang.Exception { com.google.gerrit.server.project.SetHead.Input input = new com.google.gerrit.server.project.SetHead.Input ( ) ; input.ref = newHead ; try { setHead.apply ( new com.google.gerrit.server.project.ProjectResource ( project ) , input ) ; } catch ( com.google.gerrit.extensions.restapi.UnprocessableEntityException e ) { throw die ( e ) ; } }

Target:
protected void run ( ) throws java.lang.Exception { com.google.gerrit.server.project.SetHead.Input input = new com.google.gerrit.server.project.SetHead.Input ( ) ; input.ref = newHead ; try { setHead.apply ( new com.google.gerrit.server.project.ProjectResource ( project.getProjectState ( ) , project.getUser ( ) ) , input ) ; } catch ( com.google.gerrit.extensions.restapi.UnprocessableEntityException e ) { throw die ( e ) ; } }
Source:
public static java.lang.String robotCommentsRef ( com.google.gerrit.reviewdb.client.Change.Id id ) { java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( com.google.gerrit.reviewdb.client.RefNames.REFS_CHANGES ) ; r.append ( com.google.gerrit.reviewdb.client.RefNames.shard ( id.get ( ) ) ) ; r.append ( com.google.gerrit.reviewdb.client.RefNames.ROBOT_COMMENTS_SUFFIX ) ; return r.toString ( ) ; }

Target:
public static java.lang.String robotCommentsRef ( com.google.gerrit.reviewdb.client.Change.Id id ) { java.lang.StringBuilder r = com.google.gerrit.reviewdb.client.RefNames.newStringBuilder ( ) . append ( com.google.gerrit.reviewdb.client.RefNames.REFS_CHANGES ) ; return com.google.gerrit.reviewdb.client.RefNames.shard ( id.get ( ) , r ) . append ( com.google.gerrit.reviewdb.client.RefNames.ROBOT_COMMENTS_SUFFIX ) . toString ( ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { anonRestSession = new com.google.gerrit.acceptance.RestSession ( server , null ) ; admin2 = accounts.admin2 ( ) ; com.google.gerrit.extensions.api.groups.GroupInput gi = new com.google.gerrit.extensions.api.groups.GroupInput ( ) ; gi.name = name ( "New-Group" ) ; gi.members = com.google.common.collect.ImmutableList.of ( user.id.toString ( ) ) ; newGroup = gApi.groups ( ) . create ( gi ) . get ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { anonRestSession = new com.google.gerrit.acceptance.RestSession ( server , null ) ; admin2 = accountCreator.admin2 ( ) ; com.google.gerrit.extensions.api.groups.GroupInput gi = new com.google.gerrit.extensions.api.groups.GroupInput ( ) ; gi.name = name ( "New-Group" ) ; gi.members = com.google.common.collect.ImmutableList.of ( user.id.toString ( ) ) ; newGroup = gApi.groups ( ) . create ( gi ) . get ( ) ; }
Source:
public void changeUserName ( final java.lang.String newName , final com.google.gwtjsonrpc.common.AsyncCallback < com.google.gwtjsonrpc.common.VoidResult > callback ) { if ( realm.allowsEdit ( Account.FieldName.USER_NAME ) ) { com.google.gerrit.httpd.rpc.Handler.wrap ( changeUserNameFactory.create ( newName ) ) . to ( callback ) ; } else { callback.onFailure ( new com.google.gerrit.common.errors.PermissionDeniedException ( ( "Not allowed to change" + " username" ) ) ) ; } }

Target:
public void changeUserName ( final java.lang.String newName , final com.google.gwtjsonrpc.common.AsyncCallback < com.google.gwtjsonrpc.common.VoidResult > callback ) { if ( realm.allowsEdit ( Account.FieldName.USER_NAME ) ) { if ( ( newName == null ) || ( ! ( newName.matches ( Account.USER_NAME_PATTERN ) ) ) ) { callback.onFailure ( new com.google.gerrit.common.errors.InvalidUserNameException ( ) ) ; } com.google.gerrit.httpd.rpc.Handler.wrap ( changeUserNameFactory.create ( newName ) ) . to ( callback ) ; } else { callback.onFailure ( new com.google.gerrit.common.errors.PermissionDeniedException ( "Not allowed to change username" ) ) ; } }
Source:
< K , V > com.google.inject.Provider < com.google.gerrit.server.cache.EntryCreator < K , V > > getEntryCreator ( com.google.gerrit.server.cache.CacheProvider < K , V > cp , java.lang.Class < ? extends com.google.gerrit.server.cache.EntryCreator < K , V > > type ) { com.google.inject.Key < com.google.gerrit.server.cache.EntryCreator < K , V > > key = info.newKey ( ) ; bind ( key ) . to ( type ) . in ( Scopes.SINGLETON ) ; return getProvider ( key ) ; }

Target:
< K , V > com.google.inject.Provider < com.google.gerrit.server.cache.EntryCreator < K , V > > getEntryCreator ( com.google.gerrit.server.cache.CacheProvider < K , V > cp , java.lang.Class < ? extends com.google.gerrit.server.cache.EntryCreator < K , V > > type ) { com.google.inject.Key < com.google.gerrit.server.cache.EntryCreator < K , V > > key = com.google.gerrit.server.cache.CacheModule.newKey ( ) ; bind ( key ) . to ( type ) . in ( Scopes.SINGLETON ) ; return getProvider ( key ) ; }
Source:
private com.google.gerrit.extensions.client.SubmitType getSubmitType ( com.google.gerrit.server.query.change.ChangeData cd ) { try { return cd.submitType ( ) ; } catch ( com.google.gwtorm.server.OrmException e ) { logError ( ( "Failed to get submit type for " + ( cd.getId ( ) ) ) , e ) ; return null ; } }

Target:
private com.google.gerrit.extensions.client.SubmitType getSubmitType ( com.google.gerrit.server.query.change.ChangeData cd ) { try { com.google.gerrit.common.data.SubmitTypeRecord str = cd.submitTypeRecord ( ) ; return str.isOk ( ) ? str.type : null ; } catch ( com.google.gwtorm.server.OrmException e ) { logError ( ( "Failed to get submit type for " + ( cd.getId ( ) ) ) , e ) ; return null ; } }
Source:
public static com.google.gerrit.server.notedb.NotesMigration allEnabled ( ) { org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.setBoolean ( "notedb" , null , "write" , true ) ; cfg.setBoolean ( "notedb" , "patchSetApprovals" , "read" , true ) ; cfg.setBoolean ( "notedb" , "changeMessages" , "read" , true ) ; cfg.setBoolean ( "notedb" , "comments" , "read" , true ) ; return new com.google.gerrit.server.notedb.NotesMigration ( cfg ) ; }

Target:
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 ; }
Source:
private static java.lang.reflect.Method getDefaultConfig ( java.lang.Class < ? > clazz ) { java.lang.reflect.Method result = null ; for ( java.lang.reflect.Method m : clazz.getMethods ( ) ) { com.google.gerrit.testutil.ConfigSuite.Default ann = m.getAnnotation ( com.google.gerrit.testutil.ConfigSuite.Default.class ) ; if ( ann != null ) { com.google.common.base.Preconditions.checkArgument ( ( result == null ) , "Multiple methods annotated with @ConfigSuite.Method: %s, %s" , result , m ) ; result = m ; } } return result ; }

Target:
private static java.lang.reflect.Method getDefaultConfig ( java.lang.Class < ? > clazz ) { return com.google.gerrit.testutil.ConfigSuite.getAnnotatedMethod ( clazz , com.google.gerrit.testutil.ConfigSuite.Default.class ) ; }
Source:
public void tooManyTerms ( ) throws java.lang.Exception { java.lang.String q = "file:a OR file:b OR file:c" ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( q ) ; org.junit.Assert.assertEquals ( query ( in ) , rewrite ( in ) ) ; exception.expect ( com.google.gerrit.server.query.QueryParseException.class ) ; exception.expectMessage ( "too many terms in query" ) ; rewrite ( parse ( ( q + " OR file:d" ) ) ) ; }

Target:
public void tooManyTerms ( ) throws java.lang.Exception { java.lang.String q = "file:a OR file:b OR file:c" ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( q ) ; org.junit.Assert.assertEquals ( query ( in ) , rewrite ( in ) ) ; exception.expect ( com.google.gerrit.index.query.QueryParseException.class ) ; exception.expectMessage ( "too many terms in query" ) ; rewrite ( parse ( ( q + " OR file:d" ) ) ) ; }