auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static com.google.gerrit.common.data.LabelType withDefaultValues ( java.lang.String name ) { com.google.gerrit.common.data.LabelType.checkLabelName ( name ) ; java.util.List < com.google.gerrit.common.data.LabelValue > values = new java.util.ArrayList < com.google.gerrit.common.data.LabelValue > ( 2 ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 0 ) ) , "Rejected" ) ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 1 ) ) , "Approved" ) ) ; return new com.google.gerrit.common.data.LabelType ( name , values ) ; }

Target:
public static com.google.gerrit.common.data.LabelType withDefaultValues ( java.lang.String id , java.lang.String name ) { com.google.gerrit.common.data.LabelType.checkId ( id ) ; com.google.gerrit.common.data.LabelType.checkName ( name ) ; java.util.List < com.google.gerrit.common.data.LabelValue > values = new java.util.ArrayList < com.google.gerrit.common.data.LabelValue > ( 2 ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 0 ) ) , "Rejected" ) ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 1 ) ) , "Approved" ) ) ; return new com.google.gerrit.common.data.LabelType ( id , name , values ) ; }
Source:
private static java.lang.String oldFileName ( final com.google.gerrit.server.patch.DiffCacheKey key , final org.spearce.jgit.patch.FileHeader fh ) { if ( fh != null ) { return fh.getOldName ( ) ; } if ( ( key.getSourceFileName ( ) ) != null ) { return key.getSourceFileName ( ) ; } return key.getFileName ( ) ; }

Target:
private static java.lang.String oldFileName ( final com.google.gerrit.server.patch.DiffCacheKey key , final org.spearce.jgit.patch.FileHeader fh ) { if ( fh != null ) { if ( ( org.spearce.jgit.lib.FileMode.MISSING ) == ( fh.getOldMode ( ) ) ) { return null ; } if ( FileHeader.DEV_NULL.equals ( fh.getOldName ( ) ) ) { return null ; } return fh.getOldName ( ) ; } if ( ( key.getSourceFileName ( ) ) != null ) { return key.getSourceFileName ( ) ; } return key.getFileName ( ) ; }
Source:
private java.util.Map < com.google.gerrit.client.reviewdb.ApprovalCategory.Id , java.util.Collection < com.google.gerrit.client.reviewdb.ProjectRight > > loadRights ( final com.google.gerrit.client.reviewdb.Project.Id projectId ) throws com.google.gwtorm.client.OrmException { final java.util.Map < com.google.gerrit.client.reviewdb.ApprovalCategory.Id , java.util.Collection < com.google.gerrit.client.reviewdb.ProjectRight > > rights = new java.util.HashMap < com.google.gerrit.client.reviewdb.ApprovalCategory.Id , java.util.Collection < com.google.gerrit.client.reviewdb.ProjectRight > > ( ) ; if ( projectId != null ) { loadRights ( rights , projectId ) ; } loadRights ( rights , ProjectRight.WILD_PROJECT ) ; return rights ; }

Target:
private void loadRights ( final java.util.Map < com.google.gerrit.client.reviewdb.ApprovalCategory.Id , java.util.Collection < com.google.gerrit.client.reviewdb.ProjectRight > > rights , final java.util.Collection < com.google.gerrit.client.reviewdb.ProjectRight > avail ) { for ( final com.google.gerrit.client.reviewdb.ProjectRight p : avail ) { java.util.Collection < com.google.gerrit.client.reviewdb.ProjectRight > l = rights.get ( p.getApprovalCategoryId ( ) ) ; if ( l == null ) { l = new java.util.ArrayList < com.google.gerrit.client.reviewdb.ProjectRight > ( ) ; rights.put ( p.getApprovalCategoryId ( ) , l ) ; } l.add ( p ) ; } }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { b.setEnabled ( false ) ; Util.MANAGE_SVC.rebaseChange ( patchSet.getId ( ) , new com.google.gerrit.client.changes.ChangeDetailCache.GerritWidgetCallback ( b ) ) ; }

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.rebase ( id.get ( ) , patchSet.getRevision ( ) . get ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( id ) ) ; } } ) ; }
Source:
public void putApproval ( java.lang.String label , short value ) { putApprovalFor ( getUser ( ) . getAccountId ( ) , label , value ) ; }

Target:
public org.eclipse.jgit.lib.ObjectId commit ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.notedb.NoteDbUpdateManager updateManager = updateManagerFactory.create ( getProjectName ( ) ) ; updateManager.add ( this ) ; com.google.gerrit.server.notedb.NoteDbChangeState.applyDelta ( getChange ( ) , updateManager.stage ( ) . get ( getId ( ) ) ) ; updateManager.execute ( ) ; return getResult ( ) ; }
Source:
public com.google.gerrit.server.config.PluginConfig getFromGerritConfig ( java.lang.String pluginName , boolean refresh ) { java.io.File configFile = site.gerrit_config.toFile ( ) ; if ( refresh && ( cfgSnapshot.isModified ( configFile ) ) ) { cfgSnapshot = org.eclipse.jgit.internal.storage.file.FileSnapshot.save ( configFile ) ; cfg = cfgProvider.get ( ) ; } return new com.google.gerrit.server.config.PluginConfig ( pluginName , cfg ) ; }

Target:
public com.google.gerrit.server.config.PluginConfig getFromGerritConfig ( java.lang.String pluginName , boolean refresh ) { if ( refresh && ( secureStore.isOutdated ( ) ) ) { secureStore.reload ( ) ; } java.io.File configFile = site.gerrit_config.toFile ( ) ; if ( refresh && ( cfgSnapshot.isModified ( configFile ) ) ) { cfgSnapshot = org.eclipse.jgit.internal.storage.file.FileSnapshot.save ( configFile ) ; cfg = cfgProvider.get ( ) ; } return new com.google.gerrit.server.config.PluginConfig ( pluginName , cfg ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; addPanel.setVisible ( false ) ; com.google.gerrit.client.account.ProjectCapabilities.all ( getProjectKey ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.account.ProjectCapabilities > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.account.ProjectCapabilities result ) { addPanel.setVisible ( result.canPerform ( ProjectCapabilities.CREATE_REF ) ) ; } } , ProjectCapabilities.CREATE_REF ) ; refreshBranches ( ) ; savedPanel = BRANCH ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; addPanel.setVisible ( false ) ; com.google.gerrit.client.access.AccessMap.get ( getProjectKey ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.access.ProjectAccessInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.access.ProjectAccessInfo result ) { addPanel.setVisible ( result.canAddRefs ( ) ) ; } } ) ; refreshBranches ( ) ; savedPanel = BRANCH ; }
Source:
public static void getContentOrMessage ( com.google.gerrit.reviewdb.client.PatchSet.Id id , java.lang.String path , com.google.gwt.user.client.rpc.AsyncCallback < java.lang.String > cb ) { if ( Patch.COMMIT_MSG.equals ( path ) ) { com.google.gerrit.client.changes.ChangeFileApi.getMessage ( id , cb ) ; } else { com.google.gerrit.client.changes.ChangeFileApi.contentEditOrPs ( id , path ) . get ( com.google.gerrit.client.changes.ChangeFileApi.wrapper ( cb ) ) ; } }

Target:
public static void getContentOrMessage ( com.google.gerrit.reviewdb.client.PatchSet.Id id , java.lang.String path , com.google.gwt.user.client.rpc.AsyncCallback < java.lang.String > cb ) { com.google.gerrit.client.rpc.RestApi api = ( ( Patch.COMMIT_MSG.equals ( path ) ) && ( ( id.get ( ) ) == 0 ) ) ? com.google.gerrit.client.changes.ChangeFileApi.messageEdit ( id ) : com.google.gerrit.client.changes.ChangeFileApi.contentEditOrPs ( id , path ) ; api.get ( com.google.gerrit.client.changes.ChangeFileApi.wrapper ( cb ) ) ; }
Source:
public void run ( ) { try { onStart ( ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.sshd.CommandFactoryProvider.logger.warn ( ( ( ( "Cannot start command \"" + ( cmd.getFormattedMaskedArguments ( " " ) ) ) + "\" for user " ) + ( ctx.getSession ( ) . getUsername ( ) ) ) , e ) ; } }

Target:
public void run ( ) { try { onStart ( ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.sshd.CommandFactoryProvider.logger.warn ( ( ( ( "Cannot start command \"" + ( ctx.getCommandLine ( ) ) ) + "\" for user " ) + ( ctx.getSession ( ) . getUsername ( ) ) ) , e ) ; } }
Source:
public void onLoad ( ) { if ( ( members ) == null ) { initUI ( ) ; } enableForm ( false ) ; saveDesc.setEnabled ( false ) ; super . onLoad ( ) ; Util.ADMIN_SVC.groupDetail ( groupId , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.admin.AccountGroupDetail > ( ) { public void onSuccess ( final com.google.gerrit.client.admin.AccountGroupDetail result ) { enableForm ( true ) ; saveDesc.setEnabled ( false ) ; display ( result ) ; } } ) ; }

Target:
public void onLoad ( ) { if ( ( members ) == null ) { initUI ( ) ; } enableForm ( false ) ; saveDesc.setEnabled ( false ) ; super . onLoad ( ) ; Util.GROUP_SVC.groupDetail ( groupId , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.admin.AccountGroupDetail > ( ) { public void onSuccess ( final com.google.gerrit.client.admin.AccountGroupDetail result ) { enableForm ( true ) ; saveDesc.setEnabled ( false ) ; display ( result ) ; } } ) ; }
Source:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo uploader , java.sql.Timestamp when , com.google.gerrit.extensions.api.changes.NotifyHandling notify ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.RevisionCreated.Event event = new com.google.gerrit.server.extensions.events.RevisionCreated.Event ( change , revision , uploader , when , notify ) ; for ( com.google.gerrit.extensions.events.RevisionCreatedListener l : listeners ) { try { l.onRevisionCreated ( event ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.extensions.events.RevisionCreated.log.warn ( "Error in event listener" , e ) ; } } }

Target:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo uploader , java.sql.Timestamp when , com.google.gerrit.extensions.api.changes.NotifyHandling notify ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.RevisionCreated.Event event = new com.google.gerrit.server.extensions.events.RevisionCreated.Event ( change , revision , uploader , when , notify ) ; for ( com.google.gerrit.extensions.events.RevisionCreatedListener l : listeners ) { try { l.onRevisionCreated ( event ) ; } catch ( java.lang.Exception e ) { util.logEventListenerError ( com.google.gerrit.server.extensions.events.RevisionCreated.log , e ) ; } } }
Source:
public void testBlockRule_ParentBlocksChild ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/tags/*" ) ; com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) . setBlock ( ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't update tag" , u.controlForRef ( "refs/tags/V10" ) . canUpdate ( ) ) ; }

Target:
public void testBlockRule_ParentBlocksChild ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/tags/*" ) ; com.google.gerrit.server.project.Util.block ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't update tag" , u.controlForRef ( "refs/tags/V10" ) . canUpdate ( ) ) ; }
Source:
public static java.util.Optional < java.lang.String > getUserName ( java.util.Collection < com.google.gerrit.server.account.externalids.ExternalId > extIds ) { return extIds.stream ( ) . filter ( ( e ) -> e.isScheme ( com.google.gerrit.server.account.externalids.ExternalId.SCHEME_USERNAME ) ) . map ( ( e ) -> e.key ( ) . id ( ) ) . findFirst ( ) ; }

Target:
public static java.util.Optional < java.lang.String > getUserName ( java.util.Collection < com.google.gerrit.server.account.externalids.ExternalId > extIds ) { return extIds.stream ( ) . filter ( ( e ) -> e.isScheme ( com.google.gerrit.server.account.externalids.ExternalId.SCHEME_USERNAME ) ) . map ( ( e ) -> e.key ( ) . id ( ) ) . filter ( ( u ) -> ! ( com.google.common.base.Strings.isNullOrEmpty ( u ) ) ) . findFirst ( ) ; }
Source:
private com.google.gerrit.reviewdb.client.PatchSetApproval dummyApproval ( com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , com.google.gerrit.reviewdb.client.Account.Id reviewerId ) { com.google.gerrit.reviewdb.client.ApprovalCategory.Id id = new com.google.gerrit.reviewdb.client.ApprovalCategory.Id ( com.google.common.collect.Iterables.getLast ( ctl.getLabelTypes ( ) . getLabelTypes ( ) ) . getId ( ) ) ; com.google.gerrit.reviewdb.client.PatchSetApproval dummyApproval = new com.google.gerrit.reviewdb.client.PatchSetApproval ( new com.google.gerrit.reviewdb.client.PatchSetApproval.Key ( patchSetId , reviewerId , id ) , ( ( short ) ( 0 ) ) ) ; dummyApproval.cache ( ctl.getChange ( ) ) ; return dummyApproval ; }

Target:
private com.google.gerrit.reviewdb.client.PatchSetApproval dummyApproval ( com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , com.google.gerrit.reviewdb.client.Account.Id reviewerId ) { com.google.gerrit.reviewdb.client.PatchSetApproval.LabelId id = com.google.common.collect.Iterables.getLast ( ctl.getLabelTypes ( ) . getLabelTypes ( ) ) . getLabelId ( ) ; com.google.gerrit.reviewdb.client.PatchSetApproval dummyApproval = new com.google.gerrit.reviewdb.client.PatchSetApproval ( new com.google.gerrit.reviewdb.client.PatchSetApproval.Key ( patchSetId , reviewerId , id ) , ( ( short ) ( 0 ) ) ) ; dummyApproval.cache ( ctl.getChange ( ) ) ; return dummyApproval ; }
Source:
public com.google.gerrit.server.patch.IntraLineDiff getIntraLineDiff ( com.google.gerrit.server.patch.IntraLineDiffKey key ) { if ( computeIntraline ) { try { return intraCache.get ( key ) ; } catch ( java.util.concurrent.ExecutionException | org.eclipse.jgit.errors.LargeObjectException e ) { IntraLineLoader.log.warn ( ( "Error computing " + key ) , e ) ; return new com.google.gerrit.server.patch.IntraLineDiff ( IntraLineDiff.Status.ERROR ) ; } } else { return new com.google.gerrit.server.patch.IntraLineDiff ( IntraLineDiff.Status.DISABLED ) ; } }

Target:
public com.google.gerrit.server.patch.IntraLineDiff getIntraLineDiff ( com.google.gerrit.server.patch.IntraLineDiffKey key , com.google.gerrit.server.patch.IntraLineDiffArgs args ) { if ( computeIntraline ) { try { return intraCache.get ( key , intraLoaderFactory.create ( key , args ) ) ; } catch ( java.util.concurrent.ExecutionException | org.eclipse.jgit.errors.LargeObjectException e ) { IntraLineLoader.log.warn ( ( "Error computing " + key ) , e ) ; return new com.google.gerrit.server.patch.IntraLineDiff ( IntraLineDiff.Status.ERROR ) ; } } else { return new com.google.gerrit.server.patch.IntraLineDiff ( IntraLineDiff.Status.DISABLED ) ; } }
Source:
protected Project.NameKey createProject ( java.lang.String nameSuffix , com.google.gerrit.reviewdb.client.Project.NameKey parent , boolean createEmptyCommit ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.name = name ( nameSuffix ) ; in.parent = ( parent != null ) ? parent.get ( ) : null ; in.createEmptyCommit = createEmptyCommit ; return createProject ( in ) ; }

Target:
protected Project.NameKey createProject ( java.lang.String nameSuffix , com.google.gerrit.reviewdb.client.Project.NameKey parent , boolean createEmptyCommit , com.google.gerrit.extensions.client.SubmitType submitType ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.name = name ( nameSuffix ) ; in.parent = ( parent != null ) ? parent.get ( ) : null ; in.submitType = submitType ; in.createEmptyCommit = createEmptyCommit ; return createProject ( in ) ; }
Source:
protected void configure ( ) { install ( new com.google.gerrit.extensions.restapi.RestApiModule ( ) { @ java.lang.Override protected void configure ( ) { get ( com.google.gerrit.server.project.ProjectResource.PROJECT_KIND , "lfs:config-project" ) . to ( com.googlesource.gerrit.plugins.lfs.GetLfsProjectConfig.class ) ; get ( com.google.gerrit.server.project.ProjectResource.PROJECT_KIND , "lfs:config-global" ) . to ( com.googlesource.gerrit.plugins.lfs.GetLfsGlobalConfig.class ) ; put ( com.google.gerrit.server.project.ProjectResource.PROJECT_KIND , "lfs:config-global" ) . to ( com.googlesource.gerrit.plugins.lfs.PutLfsGlobalConfig.class ) ; } } ) ; }

Target:
protected void configure ( ) { install ( new com.google.gerrit.extensions.restapi.RestApiModule ( ) { @ java.lang.Override protected void configure ( ) { get ( com.google.gerrit.server.project.ProjectResource.PROJECT_KIND , "lfs:config-project" ) . to ( com.googlesource.gerrit.plugins.lfs.GetLfsProjectConfig.class ) ; get ( com.google.gerrit.server.project.ProjectResource.PROJECT_KIND , "lfs:config-global" ) . to ( com.googlesource.gerrit.plugins.lfs.GetLfsGlobalConfig.class ) ; put ( com.google.gerrit.server.project.ProjectResource.PROJECT_KIND , "lfs:config-global" ) . to ( com.googlesource.gerrit.plugins.lfs.PutLfsGlobalConfig.class ) ; } } ) ; factory ( S3LargeFileRepository.Factory.class ) ; factory ( LocalLargeFileRepository.Factory.class ) ; }
Source:
public com.google.gerrit.server.project.ProjectControl ownerFor ( final com.google.gerrit.client.reviewdb.Project.NameKey nameKey ) throws com.google.gerrit.server.project.NoSuchProjectException { final com.google.gerrit.server.project.ProjectControl c = controlFor ( nameKey ) ; if ( ! ( c.isOwner ( ) ) ) { throw new com.google.gerrit.server.project.NoSuchProjectException ( nameKey ) ; } return c ; }

Target:
public com.google.gerrit.server.project.ProjectControl validateFor ( final com.google.gerrit.client.reviewdb.Project.NameKey nameKey , final int need ) throws com.google.gerrit.server.project.NoSuchProjectException { final com.google.gerrit.server.project.ProjectControl c = controlFor ( nameKey ) ; if ( ( ( need & ( com.google.gerrit.server.project.ProjectControl.VISIBLE ) ) == ( com.google.gerrit.server.project.ProjectControl.VISIBLE ) ) && ( c.isVisible ( ) ) ) { return c ; } if ( ( ( need & ( com.google.gerrit.server.project.ProjectControl.OWNER ) ) == ( com.google.gerrit.server.project.ProjectControl.OWNER ) ) && ( c.isOwner ( ) ) ) { return c ; } throw new com.google.gerrit.server.project.NoSuchProjectException ( nameKey ) ; }
Source:
private java.lang.String format ( final com.google.gerrit.server.git.WorkQueue.Task < ? > task ) { java.lang.String s = task.toString ( ) ; if ( ( s.length ( ) ) < ( taskNameWidth ) ) { return s ; } else { return s.substring ( 0 , taskNameWidth ) ; } }

Target:
java.lang.String getTaskString ( int maxLength ) { java.lang.String s = task.toString ( ) ; return ( s.length ( ) ) < maxLength ? s : s.substring ( 0 , maxLength ) ; }
Source:
protected void init ( ) throws com.google.gerrit.common.errors.EmailException { super . init ( ) ; setListIdHeader ( ) ; add ( RecipientType.TO , to ) ; if ( ! ( threadId.isEmpty ( ) ) ) { setHeader ( MailHeader.REFERENCES.fieldName ( ) , ( ( "<" + ( threadId ) ) + ">" ) ) ; } }

Target:
protected void init ( ) throws com.google.gerrit.common.errors.EmailException { super . init ( ) ; setListIdHeader ( ) ; setHeader ( FieldName.SUBJECT , "[Gerrit Code Review] Unable to process your email" ) ; add ( RecipientType.TO , to ) ; if ( ! ( threadId.isEmpty ( ) ) ) { setHeader ( MailHeader.REFERENCES.fieldName ( ) , ( ( "<" + ( threadId ) ) + ">" ) ) ; } }
Source:
public void onActivityCreated ( android.os.Bundle savedInstanceState ) { super . onActivityCreated ( savedInstanceState ) ; setTitle ( getString ( R.string.app_menu_review ) ) ; setHasOptionsMenu ( true ) ; com.google.reviewit.util.TaskObserver.enableProgressBar ( getWindow ( ) ) ; init ( ) ; display ( ) ; }

Target:
public void onActivityCreated ( android.os.Bundle savedInstanceState ) { super . onActivityCreated ( savedInstanceState ) ; setTitle ( getString ( R.string.app_menu_review ) ) ; setHasOptionsMenu ( true ) ; com.google.reviewit.util.TaskObserver.enableProgressBar ( getWindow ( ) ) ; init ( ) ; java.util.List < com.google.reviewit.app.Change > loadedChanges = getApp ( ) . getQueryHandler ( ) . getLoadedChanges ( ) ; if ( loadedChanges.isEmpty ( ) ) { loadAndDisplay ( ) ; } else { display ( loadedChanges ) ; } }
Source:
private com.google.gerrit.client.ui.InlineHyperlink createLink ( java.lang.String label , com.google.gerrit.reviewdb.client.PatchSet.Id id ) { assert ( other ) != null ; if ( sideA ) { assert ( other.idActive ) != null ; } return new com.google.gerrit.client.ui.InlineHyperlink ( label , com.google.gerrit.client.Dispatcher.toSideBySide ( ( sideA ? id : other.idActive ) , ( sideA ? other.idActive : id ) , path ) ) ; }

Target:
private com.google.gerrit.client.ui.InlineHyperlink createLink ( java.lang.String label , com.google.gerrit.reviewdb.client.PatchSet.Id id ) { assert ( other ) != null ; if ( sideA ) { assert ( other.idActive ) != null ; } com.google.gerrit.reviewdb.client.PatchSet.Id diffBase = ( sideA ) ? id : other.idActive ; com.google.gerrit.reviewdb.client.PatchSet.Id revision = ( sideA ) ? other.idActive : id ; return new com.google.gerrit.client.ui.InlineHyperlink ( label , ( parent.isSideBySide ( ) ? com.google.gerrit.client.Dispatcher.toSideBySide ( diffBase , revision , path ) : com.google.gerrit.client.Dispatcher.toUnified ( diffBase , revision , path ) ) ) ; }
Source:
protected void doPost ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) { this . healthy = true ; rsp.setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; }

Target:
protected void doDelete ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) { if ( ! ( currentUserProvider.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) { sendError ( rsp , javax.servlet.http.HttpServletResponse.SC_FORBIDDEN ) ; return ; } try { setUnhealthy ( ) ; rsp.setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.health.HealthServlet.log.error ( "Failed to set unhealthy" , e ) ; sendError ( rsp , javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR ) ; } }
Source:
public void onChangeMerged ( com.google.gerrit.extensions.events.ChangeMergedListener.Event ev ) { try { hooks.doChangeMergedHook ( getChange ( ev.getChange ( ) ) , getAccount ( ev.getMerger ( ) ) , getPatchSet ( ev.getRevision ( ) ) , db.get ( ) , ev.getNewRevisionId ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.common.ChangeHookApiListener.log.error ( ( "ChangeMerged hook failed to run " + ( ev.getChange ( ) . _number ) ) , e ) ; } }

Target:
public void onChangeMerged ( com.google.gerrit.extensions.events.ChangeMergedListener.Event ev ) { try { com.google.gerrit.server.notedb.ChangeNotes notes = getNotes ( ev.getChange ( ) ) ; hooks.doChangeMergedHook ( notes.getChange ( ) , getAccount ( ev.getMerger ( ) ) , getPatchSet ( notes , ev.getRevision ( ) ) , db.get ( ) , ev.getNewRevisionId ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.common.ChangeHookApiListener.log.error ( ( "ChangeMerged hook failed to run " + ( ev.getChange ( ) . _number ) ) , e ) ; } }
Source:
private < T extends com.google.gwt.core.client.JavaScriptObject > void sendRaw ( com.google.gwt.http.client.RequestBuilder.Method method , java.lang.String body , com.google.gwt.user.client.rpc.AsyncCallback < T > cb ) { com.google.gerrit.client.rpc.RestApi.HttpCallback < T > httpCallback = new com.google.gerrit.client.rpc.RestApi.HttpCallback < T > ( cb ) ; try { RpcStatus.INSTANCE.onRpcStart ( ) ; com.google.gwt.http.client.RequestBuilder req = request ( method ) ; req.setHeader ( "Content-Type" , com.google.gerrit.client.rpc.RestApi.TEXT_TYPE ) ; req.sendRequest ( body , httpCallback ) ; } catch ( com.google.gwt.http.client.RequestException e ) { httpCallback.onError ( null , e ) ; } }

Target:
private < T extends com.google.gwt.core.client.JavaScriptObject > void sendRaw ( com.google.gwt.http.client.RequestBuilder.Method method , java.lang.String body , com.google.gwt.user.client.rpc.AsyncCallback < T > cb ) { com.google.gerrit.client.rpc.RestApi.HttpCallback < T > httpCallback = new com.google.gerrit.client.rpc.RestApi.HttpCallback < T > ( background , cb ) ; try { if ( ! ( background ) ) { RpcStatus.INSTANCE.onRpcStart ( ) ; } com.google.gwt.http.client.RequestBuilder req = request ( method ) ; req.setHeader ( "Content-Type" , com.google.gerrit.client.rpc.RestApi.TEXT_TYPE ) ; req.sendRequest ( body , httpCallback ) ; } catch ( com.google.gwt.http.client.RequestException e ) { httpCallback.onError ( null , e ) ; } }
Source:
public static java.lang.String shortestExample ( java.lang.String pattern ) { if ( com.google.gerrit.server.project.RefControl.isRE ( pattern ) ) { return com.google.gerrit.server.project.RefControl.toRegExp ( pattern ) . toAutomaton ( ) . getShortestExample ( true ) ; } else if ( pattern.endsWith ( "/*" ) ) { return ( pattern.substring ( 0 , ( ( pattern.length ( ) ) - 1 ) ) ) + '1' ; } else { return pattern ; } }

Target:
public static java.lang.String shortestExample ( java.lang.String pattern ) { if ( com.google.gerrit.server.project.RefControl.isRE ( pattern ) ) { return com.google.gerrit.server.project.RefControl.toRegExp ( pattern ) . toAutomaton ( ) . getShortestExample ( true ) . replace ( '' , '-' ) ; } else if ( pattern.endsWith ( "/*" ) ) { return ( pattern.substring ( 0 , ( ( pattern.length ( ) ) - 1 ) ) ) + '1' ; } else { return pattern ; } }
Source:
private void preDisplay ( final com.google.gerrit.common.data.PatchSetPublishDetail pubDetail , final com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.common.data.PatchSetPublishDetail > origCb ) { com.google.gerrit.client.projects.ProjectApi.config ( pubDetail.getChange ( ) . getProject ( ) ) . get ( new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.projects.ConfigInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.projects.ConfigInfo result ) { commentLinkProcessor = new com.google.gerrit.client.ui.CommentLinkProcessor ( result.commentlinks ( ) ) ; display ( pubDetail ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { origCb.onFailure ( caught ) ; } } ) ; }

Target:
private void preDisplay ( final com.google.gerrit.common.data.PatchSetPublishDetail pubDetail , final com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.common.data.PatchSetPublishDetail > origCb ) { com.google.gerrit.client.projects.ConfigInfoCache.get ( pubDetail.getChange ( ) . getProject ( ) , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.projects.ConfigInfoCache.Entry > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.projects.ConfigInfoCache.Entry result ) { commentLinkProcessor = result.getCommentLinkProcessor ( ) ; display ( pubDetail ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { origCb.onFailure ( caught ) ; } } ) ; }
Source:
private void onCallback ( final com.google.gerrit.client.reviewdb.Account result ) { if ( result != null ) { com.google.gerrit.client.Gerrit.postSignIn ( ) ; hide ( ) ; if ( ( appCallback ) != null ) { com.google.gwt.user.client.DeferredCommand.addCommand ( new com.google.gwt.user.client.Command ( ) { public void execute ( ) { appCallback.onSuccess ( null ) ; } } ) ; } } else { hide ( ) ; } }

Target:
private void onCallback ( final com.google.gerrit.client.reviewdb.Account result ) { if ( result != null ) { com.google.gerrit.client.Gerrit.postSignIn ( result ) ; hide ( ) ; final com.google.gwt.user.client.rpc.AsyncCallback < ? > ac = appCallback ; if ( ac != null ) { com.google.gwt.user.client.DeferredCommand.addCommand ( new com.google.gwt.user.client.Command ( ) { public void execute ( ) { ac.onSuccess ( null ) ; } } ) ; } } else { hide ( ) ; } }
Source:
public void invalidRevision ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = insertChange ( ) ; db.patchSets ( ) . insert ( java.util.Collections.singleton ( com.google.gerrit.testutil.TestChanges.newPatchSet ( c.currentPatchSetId ( ) , "fooooooooooooooooooooooooooooooooooooooo" , adminId ) ) ) ; incrementPatchSet ( c ) ; insertPatchSet ( c ) ; assertProblems ( c , ( "Invalid revision on patch set 1:" + " fooooooooooooooooooooooooooooooooooooooo" ) ) ; }

Target:
public void patchSetObjectAndRefMissing ( ) throws java.lang.Exception { java.lang.String rev = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = insertMissingPatchSet ( ctl , rev ) ; ctl = reload ( ctl ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Ref missing: " + ( ps.getId ( ) . toRefName ( ) ) ) ) , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Object missing: patch set 2:" + " deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ) ) ; }
Source:
public void noCopyNonMinScoreOnRework ( ) throws java.lang.Exception { codeReview.setCopyMinScore ( true ) ; codeReview.setCopyMaxScore ( true ) ; saveLabelConfig ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; revision ( r ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.dislike ( ) ) ; assertApproval ( r , ( - 1 ) ) ; r = ammendChange ( r.getChangeId ( ) ) ; assertApproval ( r , 0 ) ; }

Target:
public void noCopyNonMinScoreOnRework ( ) throws java.lang.Exception { codeReview.setCopyMinScore ( true ) ; codeReview.setCopyMaxScore ( true ) ; saveLabelConfig ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; revision ( r ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.dislike ( ) ) ; assertApproval ( r , ( - 1 ) ) ; r = amendChange ( r.getChangeId ( ) ) ; assertApproval ( r , 0 ) ; }
Source:
public void onShowView ( ) { super . onShowView ( ) ; com.google.gwt.user.client.Window.enableScrolling ( false ) ; if ( prefs.hideTopMenu ( ) ) { com.google.gerrit.client.Gerrit.setHeaderVisible ( false ) ; } final int height = getCodeMirrorHeight ( ) ; cmA.setHeight ( height ) ; cmB.setHeight ( height ) ; diffTable.sidePanel.adjustGutters ( cmB ) ; cmB.setCursor ( net.codemirror.lib.LineCharacter.create ( 0 ) ) ; cmB.focus ( ) ; prefetchNextFile ( ) ; }

Target:
public void run ( ) { cmA.setHeight ( height ) ; cmB.setHeight ( height ) ; cmA.refresh ( ) ; cmB.refresh ( ) ; cmB.setCursor ( net.codemirror.lib.LineCharacter.create ( 0 ) ) ; cmB.focus ( ) ; }
Source:
public java.util.List < com.google.gerrit.server.account.GetSshKeys.SshKeyInfo > apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gwtorm.server.OrmException { if ( ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) && ( ! ( self.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "not allowed to get SSH keys" ) ; } return apply ( rsrc.getUser ( ) ) ; }

Target:
public java.util.List < com.google.gerrit.server.account.GetSshKeys.SshKeyInfo > apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gwtorm.server.OrmException { if ( ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) && ( ! ( self.get ( ) . getCapabilities ( ) . canModifyAccount ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "not allowed to get SSH keys" ) ; } return apply ( rsrc.getUser ( ) ) ; }
Source:
public void delete ( com.google.gerrit.server.edit.ChangeEdit edit ) throws java.io.IOException { com.google.gerrit.reviewdb.client.Change change = edit.getChange ( ) ; org.eclipse.jgit.lib.Repository repo = gitManager.openRepository ( change.getProject ( ) ) ; try { deleteRef ( repo , edit ) ; } finally { repo.close ( ) ; } }

Target:
public com.google.gerrit.reviewdb.client.PatchSet getBasePatchSet ( com.google.gerrit.server.edit.ChangeEdit edit ) throws com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { com.google.gerrit.reviewdb.client.Change change = edit.getChange ( ) ; org.eclipse.jgit.lib.Repository repo = gitManager.openRepository ( change.getProject ( ) ) ; try { org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ; try { return getBasePatchSet ( edit , rw.parseCommit ( edit.getRef ( ) . getObjectId ( ) ) ) ; } finally { rw.release ( ) ; } } finally { repo.close ( ) ; } }
Source:
protected < T > void doInvoke ( final boolean allowXsrf , final java.lang.String reqData , final com.google.gwtjsonrpc.client.JsonSerializer < T > ser , final com.google.gwt.user.client.rpc.AsyncCallback < T > cb ) throws com.google.gwt.user.client.rpc.InvocationException { if ( ( url ) == null ) { throw new com.google.gwtjsonrpc.client.NoServiceEntryPointSpecifiedException ( ) ; } new com.google.gwtjsonrpc.client.JsonCall < T > ( this , allowXsrf , reqData , ser , cb ) . send ( ) ; }

Target:
protected < T > void doInvoke ( final java.lang.String methodName , final boolean allowXsrf , final java.lang.String reqData , final com.google.gwtjsonrpc.client.JsonSerializer < T > ser , final com.google.gwt.user.client.rpc.AsyncCallback < T > cb ) throws com.google.gwt.user.client.rpc.InvocationException { if ( ( url ) == null ) { throw new com.google.gwtjsonrpc.client.NoServiceEntryPointSpecifiedException ( ) ; } new com.google.gwtjsonrpc.client.JsonCall < T > ( this , methodName , allowXsrf , reqData , ser , cb ) . send ( ) ; }
Source:
private static org.eclipse.jgit.lib.ObjectId emptyTree ( final org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { return new org.eclipse.jgit.lib.ObjectWriter ( repo ) . writeCanonicalTree ( new byte [ 0 ] ) ; }

Target:
private static org.eclipse.jgit.lib.ObjectId emptyTree ( final org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { org.eclipse.jgit.lib.ObjectInserter oi = repo.newObjectInserter ( ) ; try { org.eclipse.jgit.lib.ObjectId id = oi.insert ( Constants.OBJ_TREE , new byte [ ] { } ) ; oi.flush ( ) ; return id ; } finally { oi.release ( ) ; } }
Source:
public void upsertTwoSecondExisting ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE , 0 , 1 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.INSERT , 1 ) ; classUnderTest.upsert ( twoRows ) ; assertCorrectUpdating ( update , 1 , 2 ) ; assertCorrectUpdating ( insert , 1 ) ; }

Target:
public void upsertTwoSecondExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE , 0 , 1 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.INSERT , 1 ) ; classUnderTest.upsert ( twoRows ) ; assertCorrectAttempting ( update , 1 , 2 ) ; assertCorrectUpdating ( insert , 1 ) ; }
Source:
public void subsetOfBranchesVisibleIncludingHead ( ) throws java.lang.Exception { allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/master" ) ; deny ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/branch" ) ; assertRefs ( "HEAD" , "refs/changes/01/1/1" , "refs/changes/01/1/meta" , "refs/heads/master" ) ; }

Target:
public void allRefsVisibleNoRefsMetaConfig ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.server.project.Util.allow ( cfg , Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( cfg , Permission.READ , admins , "refs/meta/config" ) ; com.google.gerrit.server.project.Util.doNotInherit ( cfg , Permission.READ , "refs/meta/config" ) ; saveProjectConfig ( project , cfg ) ; assertRefs ( "HEAD" , "refs/changes/01/1/1" , "refs/changes/01/1/meta" , "refs/changes/02/2/1" , "refs/changes/02/2/meta" , "refs/heads/branch" , "refs/heads/master" , "refs/tags/branch-tag" , "refs/tags/master-tag" ) ; }
Source:
public void stop ( ) { if ( ( scanner ) != null ) { scanner.end ( ) ; } srvInfoImpl.state = ServerInformation.State.SHUTDOWN ; synchronized ( this ) { for ( com.google.gerrit.server.plugins.Plugin p : running.values ( ) ) { p.stop ( ) ; } running.clear ( ) ; broken.clear ( ) ; if ( ( cleanupHandles.size ( ) ) > ( running.size ( ) ) ) { java.lang.System.gc ( ) ; processPendingCleanups ( ) ; } } }

Target:
public void stop ( ) { if ( ( scanner ) != null ) { scanner.end ( ) ; } srvInfoImpl.state = ServerInformation.State.SHUTDOWN ; synchronized ( this ) { for ( com.google.gerrit.server.plugins.Plugin p : running.values ( ) ) { p.stop ( ) ; } running.clear ( ) ; disabled.clear ( ) ; broken.clear ( ) ; if ( ( cleanupHandles.size ( ) ) > ( running.size ( ) ) ) { java.lang.System.gc ( ) ; processPendingCleanups ( ) ; } } }
Source:
private java.util.List < com.google.gerrit.extensions.api.projects.TagInfo > listTags ( ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.project.ListTags list = listTagsProvider.get ( ) ; try { return list.apply ( checkExists ( ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot list tags" , e ) ; } }

Target:
private java.util.List < com.google.gerrit.extensions.api.projects.TagInfo > listTags ( com.google.gerrit.server.api.projects.ListTagsRequest request ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.project.ListTags list = listTagsProvider.get ( ) ; list.setLimit ( request.getLimit ( ) ) ; list.setStart ( request.getStart ( ) ) ; try { return list.apply ( checkExists ( ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot list tags" , e ) ; } }
Source:
public static com.google.gerrit.client.changes.CommentInfo createLine ( java.lang.String path , com.google.gerrit.common.changes.Side side , int line , java.lang.String in_reply_to , java.lang.String message ) { com.google.gerrit.client.changes.CommentInfo info = com.google.gerrit.client.changes.CommentInfo.createFile ( path , side , in_reply_to , message ) ; info.setLine ( line ) ; return info ; }

Target:
public static com.google.gerrit.client.changes.CommentInfo createRange ( java.lang.String path , com.google.gerrit.common.changes.Side side , int line , java.lang.String in_reply_to , java.lang.String message , com.google.gerrit.client.diff.CommentRange range ) { com.google.gerrit.client.changes.CommentInfo info = com.google.gerrit.client.changes.CommentInfo.createFile ( path , side , in_reply_to , message ) ; info.setRange ( range ) ; info.setLine ( ( range == null ? line : range.end_line ( ) ) ) ; return info ; }
Source:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { boolean ok = true ; for ( com.google.gerrit.server.change.ChangeResource rsrc : changes.values ( ) ) { try { index.apply ( rsrc , new com.google.gerrit.server.change.Index.Input ( ) ) ; } catch ( java.lang.Exception e ) { ok = false ; writeError ( "error" , java.lang.String.format ( "failed to index change %s: %s" , rsrc.getId ( ) , e.getMessage ( ) ) ) ; } } if ( ! ok ) { throw die ( "failed to index one or more changes" ) ; } }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { boolean ok = true ; for ( com.google.gerrit.server.change.ChangeResource rsrc : changes.values ( ) ) { try { index.apply ( rsrc , new com.google.gerrit.extensions.common.Input ( ) ) ; } catch ( java.lang.Exception e ) { ok = false ; writeError ( "error" , java.lang.String.format ( "failed to index change %s: %s" , rsrc.getId ( ) , e.getMessage ( ) ) ) ; } } if ( ! ok ) { throw die ( "failed to index one or more changes" ) ; } }
Source:
public void invalidRevision ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = insertChange ( ) ; db.patchSets ( ) . insert ( java.util.Collections.singleton ( com.google.gerrit.testutil.TestChanges.newPatchSet ( c.currentPatchSetId ( ) , "fooooooooooooooooooooooooooooooooooooooo" , adminId ) ) ) ; incrementPatchSet ( c ) ; insertPatchSet ( c ) ; assertProblems ( c , ( "Invalid revision on patch set 1:" + " fooooooooooooooooooooooooooooooooooooooo" ) ) ; }

Target:
public void invalidRevision ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isFalse ( ) ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( ctl.getChange ( ) . currentPatchSetId ( ) , "fooooooooooooooooooooooooooooooooooooooo" , adminId ) ; db.patchSets ( ) . update ( java.util.Collections.singleton ( ps ) ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Invalid revision on patch set 1:" + " fooooooooooooooooooooooooooooooooooooooo" ) ) ) ; }
Source:
public void shouldFireEventsWhenSomeReplicationCompleteBeforeAllTasksAreScheduled ( ) throws java.net.URISyntaxException { org.easymock.EasyMock.resetToDefault ( pushResultProcessingMock ) ; org.eclipse.jgit.transport.URIish uri1 = new org.eclipse.jgit.transport.URIish ( "git://host1/someRepo.git" ) ; pushResultProcessingMock.onRefReplicatedToOneNode ( "someProject" , "ref1" , uri1 , RefPushResult.SUCCEEDED ) ; pushResultProcessingMock.onRefReplicatedToOneNode ( "someProject" , "ref2" , uri1 , RefPushResult.SUCCEEDED ) ; pushResultProcessingMock.onRefReplicatedToAllNodes ( "someProject" , "ref1" , 1 ) ; pushResultProcessingMock.onRefReplicatedToAllNodes ( "someProject" , "ref2" , 1 ) ; pushResultProcessingMock.onAllRefsReplicatedToAllNodes ( 2 ) ; org.easymock.EasyMock.replay ( pushResultProcessingMock ) ; replicationState.increasePushTaskCount ( "someProject" , "ref1" ) ; replicationState.increasePushTaskCount ( "someProject" , "ref2" ) ; replicationState.notifyRefReplicated ( "someProject" , "ref1" , uri1 , RefPushResult.SUCCEEDED ) ; replicationState.notifyRefReplicated ( "someProject" , "ref2" , uri1 , RefPushResult.SUCCEEDED ) ; replicationState.markAllPushTasksScheduled ( ) ; org.easymock.EasyMock.verify ( pushResultProcessingMock ) ; }

Target:
public void shouldFireEventsWhenSomeReplicationCompleteBeforeAllTasksAreScheduled ( ) throws java.net.URISyntaxException { org.easymock.EasyMock.resetToDefault ( pushResultProcessingMock ) ; org.eclipse.jgit.transport.URIish uri1 = new org.eclipse.jgit.transport.URIish ( "git://host1/someRepo.git" ) ; pushResultProcessingMock.onRefReplicatedToOneNode ( "someProject" , "ref1" , uri1 , RefPushResult.SUCCEEDED , RemoteRefUpdate.Status.OK ) ; pushResultProcessingMock.onRefReplicatedToOneNode ( "someProject" , "ref2" , uri1 , RefPushResult.SUCCEEDED , RemoteRefUpdate.Status.OK ) ; pushResultProcessingMock.onRefReplicatedToAllNodes ( "someProject" , "ref1" , 1 ) ; pushResultProcessingMock.onRefReplicatedToAllNodes ( "someProject" , "ref2" , 1 ) ; pushResultProcessingMock.onAllRefsReplicatedToAllNodes ( 2 ) ; org.easymock.EasyMock.replay ( pushResultProcessingMock ) ; replicationState.increasePushTaskCount ( "someProject" , "ref1" ) ; replicationState.increasePushTaskCount ( "someProject" , "ref2" ) ; replicationState.notifyRefReplicated ( "someProject" , "ref1" , uri1 , RefPushResult.SUCCEEDED , RemoteRefUpdate.Status.OK ) ; replicationState.notifyRefReplicated ( "someProject" , "ref2" , uri1 , RefPushResult.SUCCEEDED , RemoteRefUpdate.Status.OK ) ; replicationState.markAllPushTasksScheduled ( ) ; org.easymock.EasyMock.verify ( pushResultProcessingMock ) ; }
Source:
public void run ( ) { boolean s = prefs.showWhitespaceErrors ( ) ; view.getCmFromSide ( DisplaySide.A ) . setOption ( "showTrailingSpace" , s ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "showTrailingSpace" , s ) ; }

Target:
void onAutoHideDiffTableHeader ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.autoHideDiffTableHeader ( ( ! ( e.getValue ( ) ) ) ) ; if ( ( view ) != null ) { view.setAutoHideDiffHeader ( ( ! ( e.getValue ( ) ) ) ) ; } }
Source:
private void addExtensionPoints ( com.google.gerrit.client.info.ChangeInfo change , com.google.gerrit.client.info.ChangeInfo.RevisionInfo rev ) { addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER , headerExtension , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_BUTTONS , headerExtensionMiddle , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_POP_DOWNS , headerExtensionRight , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK , changeExtension , change , rev ) ; }

Target:
private void addExtensionPoints ( com.google.gerrit.client.info.ChangeInfo change , com.google.gerrit.client.info.ChangeInfo.RevisionInfo rev ) { addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER , headerExtension , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_BUTTONS , headerExtensionMiddle , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_POP_DOWNS , headerExtensionRight , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK , changeExtension , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_RELATED_INFO_BLOCK , relatedExtension , change , rev ) ; }
Source:
private void serveGwtUi ( ) { serveRegex ( "^/gerrit_ui/(?!rpc/)(.*)$" ) . with ( com.google.inject.Key.get ( javax.servlet.http.HttpServlet.class , com.google.inject.name.Names.named ( com.google.gerrit.httpd.raw.StaticModule.GWT_UI_SERVLET ) ) ) ; if ( ( warFs ) == null ) { filter ( "/" ) . through ( new com.google.gerrit.httpd.raw.RecompileGwtUiFilter ( buckOut , unpackedWar ) ) ; } }

Target:
private void serveGwtUi ( ) { serveRegex ( "^/gerrit_ui/(?!rpc/)(.*)$" ) . with ( com.google.inject.Key.get ( javax.servlet.http.HttpServlet.class , com.google.inject.name.Names.named ( com.google.gerrit.httpd.raw.StaticModule.GWT_UI_SERVLET ) ) ) ; if ( development ) { filter ( "/" ) . through ( new com.google.gerrit.httpd.raw.RecompileGwtUiFilter ( buckOut , unpackedWar ) ) ; } }