auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean canUpdate ( ) { if ( ( RefNames.REFS_CONFIG.equals ( refName ) ) && ( ! ( projectControl.isOwner ( ) ) ) ) { if ( ! ( ( projectControl.getProjectState ( ) . isAllProjects ( ) ) && ( getCurrentUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) ) { return false ; } } return ( canPerform ( Permission.PUSH ) ) && ( canWrite ( ) ) ; }

Target:
public boolean canUpdate ( ) { if ( ( RefNames.REFS_CONFIG.equals ( refName ) ) && ( ! ( projectControl.isOwner ( ) ) ) ) { if ( ! ( ( projectControl.getProjectState ( ) . isAllProjects ( ) ) && ( getUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) ) { return false ; } } return ( canPerform ( Permission.PUSH ) ) && ( canWrite ( ) ) ; }
Source:
public void setParent_Forbidden ( ) throws java.lang.Exception { java.lang.String parent = createProject ( "parent" , null , true ) . get ( ) ; com.google.gerrit.acceptance.RestResponse r = userSession.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/parent" ) , newParentInput ( parent ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_FORBIDDEN ) ; r.consume ( ) ; }

Target:
public void setParent_Forbidden ( ) throws java.lang.Exception { java.lang.String parent = createProject ( "parent" , null , true ) . get ( ) ; com.google.gerrit.acceptance.RestResponse r = userSession.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/parent" ) , newParentInput ( parent ) ) ; r.assertForbidden ( ) ; r.consume ( ) ; }
Source:
private static boolean hasUserName ( ) { return ( ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) && ( ( com.google.gerrit.client.Gerrit.getUserAccount ( ) . getUserName ( ) ) != null ) ) && ( ( com.google.gerrit.client.Gerrit.getUserAccount ( ) . getUserName ( ) . length ( ) ) > 0 ) ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { event.preventDefault ( ) ; event.stopPropagation ( ) ; select ( ) ; if ( ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) && ( ( urlType ) != null ) ) { com.google.gerrit.reviewdb.client.AccountGeneralPreferences pref = com.google.gerrit.client.Gerrit.getUserAccount ( ) . getGeneralPreferences ( ) ; pref.setDownloadUrl ( urlType ) ; com.google.gerrit.client.account.Util.ACCOUNT_SVC.changePreferences ( pref , new com.google.gwtjsonrpc.common.AsyncCallback < com.google.gwtjsonrpc.common.VoidResult > ( ) { @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } @ java.lang.Override public void onSuccess ( com.google.gwtjsonrpc.common.VoidResult result ) { } } ) ; } }
Source:
void setOpen ( boolean open ) { com.google.gwt.user.client.ui.UIObject.setVisible ( summary , ( ! open ) ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( message , open ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( buttons , open ) ; if ( open ) { removeStyleName ( style.closed ( ) ) ; } else { addStyleName ( style.closed ( ) ) ; } super . setOpen ( open ) ; }

Target:
void setOpen ( boolean open ) { com.google.gwt.user.client.ui.UIObject.setVisible ( summary , ( ! open ) ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( message , open ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( buttons , ( open && ( ( replyBox ) == null ) ) ) ; if ( open ) { removeStyleName ( style.closed ( ) ) ; } else { addStyleName ( style.closed ( ) ) ; } super . setOpen ( open ) ; }
Source:
public java.lang.String render ( java.lang.String varName ) { if ( com.google.gerrit.common.data.Permission.isLabel ( varName ) ) { return Util.M.label ( new com.google.gerrit.common.data.Permission ( varName ) . getLabel ( ) ) ; } java.lang.String desc = com.google.gerrit.client.admin.PermissionNameRenderer.all.get ( varName ) ; if ( desc == null ) { desc = com.google.gerrit.client.admin.PermissionNameRenderer.all.get ( varName.toLowerCase ( ) ) ; } return desc != null ? desc : varName ; }

Target:
public java.lang.String render ( java.lang.String varName ) { if ( com.google.gerrit.common.data.Permission.isLabelAs ( varName ) ) { return Util.M.labelAs ( com.google.gerrit.common.data.Permission.extractLabel ( varName ) ) ; } else if ( com.google.gerrit.common.data.Permission.isLabel ( varName ) ) { return Util.M.label ( com.google.gerrit.common.data.Permission.extractLabel ( varName ) ) ; } java.lang.String desc = com.google.gerrit.client.admin.PermissionNameRenderer.all.get ( varName ) ; if ( desc == null ) { desc = com.google.gerrit.client.admin.PermissionNameRenderer.all.get ( varName.toLowerCase ( ) ) ; } return desc != null ? desc : varName ; }
Source:
public void go ( ) { if ( ( com.google.gerrit.client.Gerrit.patchScreen ) != null ) { com.google.gerrit.client.Gerrit.patchScreen.setTopView ( tv ) ; } com.google.gwt.dom.client.AnchorElement.as ( getElement ( ) ) . blur ( ) ; }

Target:
public void onScreenLoad ( com.google.gerrit.client.ui.ScreenLoadEvent event ) { com.google.gerrit.client.ui.Screen screen = event.getScreen ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectKey ; if ( screen instanceof com.google.gerrit.client.admin.ProjectScreen ) { projectKey = ( ( com.google.gerrit.client.admin.ProjectScreen ) ( screen ) ) . getProjectKey ( ) ; } else { projectKey = com.google.gerrit.client.admin.ProjectScreen.getSavedKey ( ) ; } if ( projectKey != null ) { setVisible ( true ) ; setTargetHistoryToken ( com.google.gerrit.client.Dispatcher.toProjectAdmin ( projectKey , panel ) ) ; } else { setVisible ( false ) ; } super . onScreenLoad ( event ) ; }
Source:
private void initTcpIpForwardFilter ( ) { setTcpIpForwardFilter ( new org.apache.sshd.server.TcpIpForwardFilter ( ) { @ java.lang.Override public boolean canConnect ( java.net.InetSocketAddress address , org.apache.sshd.server.session.ServerSession session ) { return false ; } @ java.lang.Override public boolean canListen ( java.net.InetSocketAddress address , org.apache.sshd.server.session.ServerSession session ) { return false ; } } ) ; }

Target:
private void initForwardingFilter ( ) { setForwardingFilter ( new org.apache.sshd.server.ForwardingFilter ( ) { @ java.lang.Override public boolean canForwardAgent ( org.apache.sshd.server.session.ServerSession session ) { return false ; } @ java.lang.Override public boolean canForwardX11 ( org.apache.sshd.server.session.ServerSession session ) { return false ; } @ java.lang.Override public boolean canConnect ( java.net.InetSocketAddress address , org.apache.sshd.server.session.ServerSession session ) { return false ; } @ java.lang.Override public boolean canListen ( java.net.InetSocketAddress address , org.apache.sshd.server.session.ServerSession session ) { return false ; } } ) ; }
Source:
private com.googlesource.gerrit.plugins.reviewers.ReviewerFilterSection newReviewerFilterSection ( java.lang.String filter ) { com.google.common.collect.ImmutableSet.Builder < java.lang.String > b = com.google.common.collect.ImmutableSet.builder ( ) ; for ( java.lang.String reviewer : cfg.getStringList ( com.googlesource.gerrit.plugins.reviewers.ReviewersConfig.FILTER , filter , "reviewer" ) ) { b.add ( reviewer ) ; } return new com.googlesource.gerrit.plugins.reviewers.ReviewerFilterSection ( filter , b.build ( ) ) ; }

Target:
void addReviewer ( java.lang.String filter , java.lang.String reviewer ) { if ( ! ( newReviewerFilterSection ( filter ) . getReviewers ( ) . contains ( reviewer ) ) ) { java.util.List < java.lang.String > values = new java.util.ArrayList ( java.util.Arrays.asList ( cfg.getStringList ( com.googlesource.gerrit.plugins.reviewers.ReviewersConfig.FILTER , filter , com.googlesource.gerrit.plugins.reviewers.ReviewersConfig.REVIEWER ) ) ) ; values.add ( reviewer ) ; cfg.setStringList ( com.googlesource.gerrit.plugins.reviewers.ReviewersConfig.FILTER , filter , com.googlesource.gerrit.plugins.reviewers.ReviewersConfig.REVIEWER , values ) ; } }
Source:
public void testGetIssuePatternNullMatch ( ) { com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "ItsTestName" , null , "commentlink" ) ) . andReturn ( null ) . atLeastOnce ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "commentlink" , "ItsTestName" , "match" ) ) . andReturn ( null ) . atLeastOnce ( ) ; replayMocks ( ) ; assertNull ( "Pattern for null match is not null" , itsConfig.getIssuePattern ( ) ) ; }

Target:
public void testGetIssuePatternNullMatch ( ) { com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "plugin" , "ItsTestName" , "commentlink" ) ) . andReturn ( null ) . atLeastOnce ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "commentlink" , "ItsTestName" , "match" ) ) . andReturn ( null ) . atLeastOnce ( ) ; replayMocks ( ) ; assertNull ( "Pattern for null match is not null" , itsConfig.getIssuePattern ( ) ) ; }
Source:
private java.util.List < org.kohsuke.github.GHRepository > getRepositories ( com.googlesource.gerrit.plugins.github.oauth.GitHubLogin hubLogin , java.lang.String organisation ) throws java.io.IOException { if ( organisation.equals ( hubLogin.getMyself ( ) . getLogin ( ) ) ) { return hubLogin.getMyself ( ) . listRepositories ( com.googlesource.gerrit.plugins.github.wizard.RepositoriesListController.PAGE_SIZE ) . asList ( ) ; } else { org.kohsuke.github.GHOrganization ghOrganisation = hubLogin.getMyself ( ) . getOrganizations ( ) . byLogin ( organisation ) ; return ghOrganisation.listRepositories ( com.googlesource.gerrit.plugins.github.wizard.RepositoriesListController.PAGE_SIZE ) . asList ( ) ; } }

Target:
private org.kohsuke.github.PagedIterable < org.kohsuke.github.GHRepository > getRepositories ( com.googlesource.gerrit.plugins.github.oauth.GitHubLogin hubLogin , java.lang.String organisation ) throws java.io.IOException { if ( organisation.equals ( hubLogin.getMyself ( ) . getLogin ( ) ) ) { return hubLogin.getMyself ( ) . listRepositories ( config.repositoryListPageSize ) ; } else { org.kohsuke.github.GHOrganization ghOrganisation = hubLogin.getMyself ( ) . getOrganizations ( ) . byLogin ( organisation ) ; return ghOrganisation.listRepositories ( config.repositoryListPageSize ) ; } }
Source:
public void onEvent ( com.google.gerrit.server.events.Event event ) { if ( event instanceof com.google.gerrit.server.events.ChangeMergedEvent ) { com.google.gerrit.server.events.ChangeMergedEvent changeMergedEvent = ( ( com.google.gerrit.server.events.ChangeMergedEvent ) ( event ) ) ; mergeResults.put ( changeMergedEvent.change.get ( ) . number , changeMergedEvent.newRev ) ; } }

Target:
public void onEvent ( com.google.gerrit.server.events.Event event ) { if ( ! ( event instanceof com.google.gerrit.server.events.ChangeMergedEvent ) ) { return ; } com.google.gerrit.server.events.ChangeMergedEvent e = ( ( com.google.gerrit.server.events.ChangeMergedEvent ) ( event ) ) ; com.google.gerrit.server.data.ChangeAttribute c = e.change.get ( ) ; com.google.gerrit.server.data.PatchSetAttribute ps = e.patchSet.get ( ) ; com.google.gerrit.acceptance.rest.change.AbstractSubmit.log.debug ( "Merged {},{} as {}" , ps.number , c.number , e.newRev ) ; mergeResults.put ( e.change.get ( ) . number , e.newRev ) ; }
Source:
public void run ( ) { if ( ( prefs.context ( ) ) == ( com.google.gerrit.reviewdb.client.AccountDiffPreference.WHOLE_FILE_CONTEXT ) ) { contextEntireFile.setValue ( true ) ; } if ( view.canEnableRenderEntireFile ( prefs ) ) { renderEntireFile.setEnabled ( true ) ; } else { if ( prefs.renderEntireFile ( ) ) { prefs.renderEntireFile ( false ) ; renderEntireFile.setValue ( false ) ; view.updateRenderEntireFile ( ) ; } renderEntireFile.setEnabled ( false ) ; } view.setContext ( prefs.context ( ) ) ; }

Target:
public void run ( ) { if ( ( prefs.context ( ) ) == ( com.google.gerrit.reviewdb.client.AccountDiffPreference.WHOLE_FILE_CONTEXT ) ) { contextEntireFile.setValue ( true ) ; } if ( view.canRenderEntireFile ( prefs ) ) { renderEntireFile.setEnabled ( true ) ; renderEntireFile.setValue ( prefs.renderEntireFile ( ) ) ; } else { renderEntireFile.setValue ( false ) ; renderEntireFile.setEnabled ( false ) ; } view.setContext ( prefs.context ( ) ) ; }
Source:
public void stop ( ) { try { eventsDb.close ( ) ; } catch ( java.sql.SQLException e ) { com.ericsson.gerrit.plugins.eventslog.SQLStore.log.warn ( "Cannot close datasource " , e ) ; } try { localEventsDb.close ( ) ; } catch ( java.sql.SQLException e ) { com.ericsson.gerrit.plugins.eventslog.SQLStore.log.warn ( "Cannot close datasource " , e ) ; } }

Target:
public void stop ( ) { if ( ( task ) != null ) { task.cancel ( true ) ; } try { eventsDb.close ( ) ; } catch ( java.sql.SQLException e ) { com.ericsson.gerrit.plugins.eventslog.SQLStore.log.warn ( "Cannot close datasource " , e ) ; } try { localEventsDb.close ( ) ; } catch ( java.sql.SQLException e ) { com.ericsson.gerrit.plugins.eventslog.SQLStore.log.warn ( "Cannot close datasource " , e ) ; } }
Source:
public java.util.Collection < com.google.gerrit.server.index.ChangeIndex > getWriteIndexes ( ) { return java.util.Collections.unmodifiableCollection ( writeIndexes.values ( ) ) ; }

Target:
public synchronized void addWriteIndex ( com.google.gerrit.server.index.ChangeIndex index ) { int version = index.getSchema ( ) . getVersion ( ) ; for ( com.google.gerrit.server.index.ChangeIndex i : writeIndexes ) { if ( ( i.getSchema ( ) . getVersion ( ) ) == version ) { throw new java.lang.IllegalArgumentException ( ( ( "Write index version " + version ) + " already in list" ) ) ; } } writeIndexes.add ( index ) ; }
Source:
public void index ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws java.io.IOException { index ( changeDataFactory.create ( db , project , changeId ) ) ; }

Target:
private com.google.gerrit.server.query.change.ChangeData newChangeData ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { if ( ! ( notesMigration.readChanges ( ) ) ) { com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.createWithAutoRebuildingDisabled ( db , project , changeId ) ; return changeDataFactory.create ( db , notes ) ; } return changeDataFactory.create ( db , project , changeId ) ; }
Source:
private void addPriority ( java.util.Map < java.lang.String , java.lang.Object > have , com.google.gerrit.server.account.CapabilityControl cc ) { com.google.gerrit.server.git.QueueProvider.QueueType queue = cc.getQueueType ( ) ; if ( ( queue != ( QueueProvider.QueueType.INTERACTIVE ) ) || ( ( ( query ) != null ) && ( query.contains ( com.google.gerrit.common.data.GlobalCapability.PRIORITY ) ) ) ) { have.put ( com.google.gerrit.common.data.GlobalCapability.PRIORITY , queue ) ; } }

Target:
private void addPriority ( java.util.Map < java.lang.String , java.lang.Object > have , com.google.gerrit.server.account.AccountLimits limits ) { com.google.gerrit.server.git.QueueProvider.QueueType queue = limits.getQueueType ( ) ; if ( ( queue != ( QueueProvider.QueueType.INTERACTIVE ) ) || ( ( ( query ) != null ) && ( query.contains ( com.google.gerrit.common.data.GlobalCapability.PRIORITY ) ) ) ) { have.put ( com.google.gerrit.common.data.GlobalCapability.PRIORITY , queue ) ; } }
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 ( ) { new com.google.gwtexpui.globalkey.client.ShowHelpCommand ( ) . onKeyPress ( null ) ; }
Source:
private com.amd.gerrit.plugins.manifestsubscription.VersionedManifests parseManifests ( com.google.gerrit.reviewdb.client.Project.NameKey p , java.lang.String refName ) throws java.io.IOException , javax.xml.bind.JAXBException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.git.MetaDataUpdate update = metaDataUpdateFactory.create ( p ) ; com.amd.gerrit.plugins.manifestsubscription.VersionedManifests vManifests = new com.amd.gerrit.plugins.manifestsubscription.VersionedManifests ( refName ) ; vManifests.load ( update ) ; return vManifests ; }

Target:
private com.amd.gerrit.plugins.manifestsubscription.VersionedManifests parseManifests ( com.google.gerrit.reviewdb.client.Project.NameKey p , java.lang.String refName ) throws java.io.IOException , javax.xml.bind.JAXBException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.Repository repo = gitRepoManager.openRepository ( p ) ; org.eclipse.jgit.lib.ObjectId commitId = repo.resolve ( refName ) ; com.google.gerrit.server.git.MetaDataUpdate update = metaDataUpdateFactory.create ( p ) ; com.amd.gerrit.plugins.manifestsubscription.VersionedManifests vManifests = new com.amd.gerrit.plugins.manifestsubscription.VersionedManifests ( refName ) ; vManifests.load ( update , commitId ) ; return vManifests ; }
Source:
public boolean deleteChangeFromIndex ( int changeId ) { try { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult result = httpSession.delete ( buildIndexEndpoint ( changeId ) ) ; if ( result.isSuccessful ( ) ) { return true ; } com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.log.error ( "Unable to delete from index change {}. Cause: {}" , changeId , result.getMessage ( ) ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.log.error ( ( "Error trying to delete from index change " + changeId ) , e ) ; } return false ; }

Target:
com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult send ( ) throws java.io.IOException { java.lang.String serializedEvent = new com.google.gson.GsonBuilder ( ) . registerTypeAdapter ( com.google.common.base.Supplier.class , new com.google.gerrit.server.events.SupplierSerializer ( ) ) . create ( ) . toJson ( event ) ; return httpSession.post ( com.google.common.base.Joiner.on ( "/" ) . join ( pluginRelativePath , "event" ) , serializedEvent ) ; }
Source:
boolean hasDynamicItem ( com.google.inject.TypeLiteral < ? > type ) { return sysItems.containsKey ( type ) ; }

Target:
boolean hasDynamicItem ( com.google.inject.TypeLiteral < ? > type ) { return ( ( sysItems.containsKey ( type ) ) || ( ( ( sshItems ) != null ) && ( sshItems.containsKey ( type ) ) ) ) || ( ( ( httpItems ) != null ) && ( httpItems.containsKey ( type ) ) ) ; }
Source:
public com.google.gerrit.reviewdb.client.Change abandon ( com.google.gerrit.server.project.ChangeControl control ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException { return abandon ( control , "" , NotifyHandling.ALL ) ; }

Target:
public com.google.gerrit.extensions.common.ChangeInfo apply ( com.google.gerrit.server.change.ChangeResource req , com.google.gerrit.extensions.api.changes.AbandonInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.project.ChangeControl control = req.getControl ( ) ; if ( ! ( control.canAbandon ( dbProvider.get ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "abandon not permitted" ) ; } com.google.gerrit.reviewdb.client.Change change = abandon ( control , input.message , input.notify , notifyUtil.resolveAccounts ( input.notifyDetails ) ) ; return json.create ( ChangeJson.NO_OPTIONS ) . format ( change ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { final com.google.gwt.user.client.ui.HTMLTable.Cell cell = table.getCellForEvent ( event ) ; if ( ( ( cell != null ) && ( ( cell.getCellIndex ( ) ) != 1 ) ) && ( ( getRowItem ( cell.getRowIndex ( ) ) ) != null ) ) { movePointerTo ( cell.getRowIndex ( ) ) ; } }

Target:
public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.client.reviewdb.AccountGroupMember k = getRowItem ( row ) ; if ( ( k != null ) && ( ids.contains ( k.getKey ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }
Source:
public com.google.gerrit.server.events.PatchSetCommentAttribute asPatchSetLineAttribute ( com.google.gerrit.reviewdb.PatchLineComment c ) { com.google.gerrit.server.events.PatchSetCommentAttribute a = new com.google.gerrit.server.events.PatchSetCommentAttribute ( ) ; a.reviewer = asAccountAttribute ( c.getAuthor ( ) ) ; a.file = c.getKey ( ) . getParentKey ( ) . get ( ) ; a.line = c.getLine ( ) ; a.message = c.getMessage ( ) ; return a ; }

Target:
public com.google.gerrit.server.events.PatchSetCommentAttribute asPatchSetLineAttribute ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { com.google.gerrit.server.events.PatchSetCommentAttribute a = new com.google.gerrit.server.events.PatchSetCommentAttribute ( ) ; a.reviewer = asAccountAttribute ( c.getAuthor ( ) ) ; a.file = c.getKey ( ) . getParentKey ( ) . get ( ) ; a.line = c.getLine ( ) ; a.message = c.getMessage ( ) ; return a ; }
Source:
void onWhitespaceErrors ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.showWhitespaceErrors ( e.getValue ( ) ) ; if ( ( view ) != null ) { view.operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { boolean s = prefs.showWhitespaceErrors ( ) ; view.getCmFromSide ( DisplaySide.A ) . setOption ( "showTrailingSpace" , s ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "showTrailingSpace" , s ) ; } } ) ; } }

Target:
void onWhitespaceErrors ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.showWhitespaceErrors ( e.getValue ( ) ) ; if ( ( view ) != null ) { view.operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { boolean s = prefs.showWhitespaceErrors ( ) ; for ( net.codemirror.lib.CodeMirror cm : view.getCms ( ) ) { cm.setOption ( "showTrailingSpace" , s ) ; } } } ) ; } }
Source:
public void addPatchSets ( com.google.gerrit.server.data.ChangeAttribute a , java.util.Collection < com.google.gerrit.reviewdb.client.PatchSet > ps , com.google.gerrit.common.data.LabelTypes labelTypes ) { addPatchSets ( a , ps , null , false , null , labelTypes ) ; }

Target:
public void addPatchSets ( com.google.gerrit.reviewdb.server.ReviewDb db , org.eclipse.jgit.revwalk.RevWalk revWalk , com.google.gerrit.server.data.ChangeAttribute ca , java.util.Collection < com.google.gerrit.reviewdb.client.PatchSet > ps , java.util.Map < com.google.gerrit.reviewdb.client.PatchSet.Id , java.util.Collection < com.google.gerrit.reviewdb.client.PatchSetApproval > > approvals , com.google.gerrit.common.data.LabelTypes labelTypes ) { addPatchSets ( db , revWalk , ca , ps , approvals , false , null , labelTypes ) ; }
Source:
private com.google.gerrit.reviewdb.client.PatchSet updateDraftPatchSet ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { return dbProvider.get ( ) . patchSets ( ) . atomicUpdate ( rsrc.getPatchSet ( ) . getId ( ) , new com.google.gwtorm.server.AtomicUpdate < com.google.gerrit.reviewdb.client.PatchSet > ( ) { @ java.lang.Override public com.google.gerrit.reviewdb.client.PatchSet update ( com.google.gerrit.reviewdb.client.PatchSet patchset ) { patchset.setDraft ( false ) ; return patchset ; } } ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.change.RevisionResource rsrc , com.google.gerrit.server.change.PublishDraftPatchSet.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException { return apply ( rsrc.getUser ( ) , rsrc.getChange ( ) , rsrc.getPatchSet ( ) . getId ( ) , rsrc.getPatchSet ( ) ) ; }
Source:
public void deleteReviewerFromReviewableWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableWipChange ( ) ; removeReviewer ( sc , extraReviewer ) ; assertThat ( sender ) . notSent ( ) ; }

Target:
public void deleteReviewerFromWipChangeNotifyAll ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChangeWithExtraReviewer ( ) ; removeReviewer ( sc , extraReviewer , NotifyHandling.ALL ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . to ( extraReviewer ) . cc ( extraCcer , sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) . noOneElse ( ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.server.change.CommentInfo > apply ( com.google.gerrit.server.change.DraftResource rsrc , com.google.gerrit.server.change.DeleteDraft.Input input ) throws com.google.gwtorm.server.OrmException { db.get ( ) . patchComments ( ) . delete ( java.util.Collections.singleton ( rsrc.getComment ( ) ) ) ; return com.google.gerrit.extensions.restapi.Response.none ( ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.CommentInfo > apply ( com.google.gerrit.server.change.DraftResource rsrc , com.google.gerrit.server.change.DeleteDraft.Input input ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.notedb.ChangeUpdate update = updateFactory.create ( rsrc.getControl ( ) ) ; com.google.gerrit.reviewdb.client.PatchLineComment c = rsrc.getComment ( ) ; com.google.gerrit.server.PatchLineCommentsUtil.setCommentRevId ( c , patchListCache , rsrc.getChange ( ) , rsrc.getPatchSet ( ) ) ; plcUtil.deleteComments ( db.get ( ) , update , java.util.Collections.singleton ( c ) ) ; update.commit ( ) ; return com.google.gerrit.extensions.restapi.Response.none ( ) ; }
Source:
void onCancel ( com.google.gwt.event.dom.client.ClickEvent e ) { setEdit ( false ) ; getCm ( ) . focus ( ) ; }

Target:
void onCancel ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; if ( ( isNew ( ) ) && ( ! ( isDirty ( ) ) ) ) { removeUI ( ) ; } else { setEdit ( false ) ; cm.focus ( ) ; } }
Source:
protected void doPost ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) { if ( ! ( currentUserProvider.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) { sendError ( rsp , javax.servlet.http.HttpServletResponse.SC_FORBIDDEN ) ; return ; } this . healthy = true ; rsp.setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; }

Target:
protected void doPost ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) { if ( ! ( permissionBackend.user ( currentUserProvider.get ( ) ) . testOrFalse ( com.google.gerrit.server.permissions.GlobalPermission.ADMINISTRATE_SERVER ) ) ) { sendError ( rsp , javax.servlet.http.HttpServletResponse.SC_FORBIDDEN ) ; return ; } this . healthy = true ; rsp.setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; }
Source:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change change ) { if ( ( change.getStatus ( ) ) == ( Change.Status.DRAFT ) ) { change.setStatus ( Change.Status.NEW ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; } return change ; }

Target:
private void saveChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { change = ctx.getChange ( ) ; wasDraftChange = ( change.getStatus ( ) ) == ( Change.Status.DRAFT ) ; if ( wasDraftChange ) { change.setStatus ( Change.Status.NEW ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; ctx.getDb ( ) . changes ( ) . update ( java.util.Collections.singleton ( change ) ) ; } }
Source:
public void onShowView ( ) { super . onShowView ( ) ; com.google.gwt.user.client.Window.enableScrolling ( 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 onShowView ( ) { super . onShowView ( ) ; com.google.gwt.user.client.Window.enableScrolling ( false ) ; final int height = getCodeMirrorHeight ( ) ; operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { cmA.setHeight ( height ) ; cmB.setHeight ( height ) ; cmA.refresh ( ) ; cmB.refresh ( ) ; cmB.setCursor ( net.codemirror.lib.LineCharacter.create ( 0 ) ) ; cmB.focus ( ) ; } } ) ; diffTable.sidePanel.adjustGutters ( cmB ) ; prefetchNextFile ( ) ; }
Source:
public void testPatternNullMatch ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "commentLink" , "ItsTestName" , "match" ) ) . andReturn ( null ) . atLeastOnce ( ) ; replayMocks ( ) ; assertNull ( "Pattern for null match is not null" , itsConfig.getIssuePattern ( ) ) ; }

Target:
public void testItsAssociationPolicyMandatory ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getEnum ( "commentlink" , "ItsTestName" , "association" , ItsAssociationPolicy.OPTIONAL ) ) . andReturn ( ItsAssociationPolicy.MANDATORY ) . atLeastOnce ( ) ; replayMocks ( ) ; assertEquals ( "Expected and generated associated policy do not match" , ItsAssociationPolicy.MANDATORY , itsConfig.getItsAssociationPolicy ( ) ) ; }
Source:
public com.googlecode.prolog_cafe.lang.Operation switch_on_term ( com.googlecode.prolog_cafe.lang.Operation var , com.googlecode.prolog_cafe.lang.Operation Int , com.googlecode.prolog_cafe.lang.Operation flo , com.googlecode.prolog_cafe.lang.Operation con , com.googlecode.prolog_cafe.lang.Operation str , com.googlecode.prolog_cafe.lang.Operation lis ) { com.googlecode.prolog_cafe.lang.Term arg1 = r1.dereference ( ) ; if ( arg1 instanceof com.googlecode.prolog_cafe.lang.VariableTerm ) return var ; if ( arg1 instanceof com.googlecode.prolog_cafe.lang.IntegerTerm ) return Int ; if ( arg1 instanceof com.googlecode.prolog_cafe.lang.DoubleTerm ) return flo ; if ( arg1 instanceof com.googlecode.prolog_cafe.lang.SymbolTerm ) return con ; if ( arg1 instanceof com.googlecode.prolog_cafe.lang.StructureTerm ) return str ; if ( arg1 instanceof com.googlecode.prolog_cafe.lang.ListTerm ) return lis ; return var ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation switch_on_term ( com.googlecode.prolog_cafe.lang.Operation var , com.googlecode.prolog_cafe.lang.Operation Int , com.googlecode.prolog_cafe.lang.Operation flo , com.googlecode.prolog_cafe.lang.Operation con , com.googlecode.prolog_cafe.lang.Operation str , com.googlecode.prolog_cafe.lang.Operation lis ) { switch ( r1.dereference ( ) . type ( ) ) { case Term.TYPE_VARIABLE : return var ; case Term.TYPE_INTEGER : return Int ; case Term.TYPE_DOUBLE : return flo ; case Term.TYPE_SYMBOL : return con ; case Term.TYPE_STRUCTURE : return str ; case Term.TYPE_LIST : return lis ; default : return var ; } }
Source:
private static void mergeTestConfig ( org.eclipse.jgit.lib.Config cfg ) { java.lang.String forceEphemeralPort = java.lang.String.format ( "%s:0" , com.google.gerrit.acceptance.GerritServer.getLocalHost ( ) . getHostName ( ) ) ; java.lang.String url = ( "http://" + forceEphemeralPort ) + "/" ; cfg.setString ( "gerrit" , null , "canonicalWebUrl" , url ) ; cfg.setString ( "httpd" , null , "listenUrl" , url ) ; cfg.setString ( "sshd" , null , "listenAddress" , forceEphemeralPort ) ; cfg.setString ( "cache" , null , "directory" , null ) ; cfg.setString ( "gerrit" , null , "basePath" , "git" ) ; cfg.setBoolean ( "sendemail" , null , "enable" , false ) ; cfg.setInt ( "cache" , "projects" , "checkFrequency" , 0 ) ; cfg.setInt ( "plugins" , null , "checkFrequency" , 0 ) ; }

Target:
private static void mergeTestConfig ( org.eclipse.jgit.lib.Config cfg ) { java.lang.String forceEphemeralPort = java.lang.String.format ( "%s:0" , com.google.gerrit.acceptance.GerritServer.getLocalHost ( ) . getHostName ( ) ) ; java.lang.String url = ( "http://" + forceEphemeralPort ) + "/" ; cfg.setString ( "gerrit" , null , "canonicalWebUrl" , url ) ; cfg.setString ( "httpd" , null , "listenUrl" , url ) ; cfg.setString ( "sshd" , null , "listenAddress" , forceEphemeralPort ) ; cfg.setBoolean ( "sshd" , null , "testUseInsecureRandom" , true ) ; cfg.setString ( "cache" , null , "directory" , null ) ; cfg.setString ( "gerrit" , null , "basePath" , "git" ) ; cfg.setBoolean ( "sendemail" , null , "enable" , false ) ; cfg.setInt ( "cache" , "projects" , "checkFrequency" , 0 ) ; cfg.setInt ( "plugins" , null , "checkFrequency" , 0 ) ; }
Source:
public void start ( ) { }

Target:
public void add ( com.google.gerrit.extensions.registration.RegistrationHandle handle ) { if ( handle instanceof com.google.gerrit.extensions.registration.ReloadableRegistrationHandle ) { if ( ( reloadableHandles ) == null ) { reloadableHandles = com.google.common.collect.Lists.newArrayList ( ) ; } reloadableHandles.add ( ( ( com.google.gerrit.extensions.registration.ReloadableRegistrationHandle < ? > ) ( handle ) ) ) ; } manager.add ( handle ) ; }
Source:
public void clearReviewed ( com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { try ( java.sql.Connection con = ds.getConnection ( ) ; java.sql.PreparedStatement stmt = con.prepareStatement ( ( "DELETE FROM ACCOUNT_PATCH_REVIEWS " + "WHERE CHANGE_ID + ? AND PATCH_SET_ID = ?" ) ) ) { stmt.setInt ( 1 , psId.getParentKey ( ) . get ( ) ) ; stmt.setInt ( 2 , psId.get ( ) ) ; stmt.executeUpdate ( ) ; } catch ( java.sql.SQLException e ) { throw com.google.gerrit.server.schema.H2AccountPatchReviewStore.convertError ( "delete" , e ) ; } }

Target:
public void clearReviewed ( com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { try ( java.sql.Connection con = ds.getConnection ( ) ; java.sql.PreparedStatement stmt = con.prepareStatement ( ( "DELETE FROM ACCOUNT_PATCH_REVIEWS " + "WHERE CHANGE_ID = ? AND PATCH_SET_ID = ?" ) ) ) { stmt.setInt ( 1 , psId.getParentKey ( ) . get ( ) ) ; stmt.setInt ( 2 , psId.get ( ) ) ; stmt.executeUpdate ( ) ; } catch ( java.sql.SQLException e ) { throw com.google.gerrit.server.schema.H2AccountPatchReviewStore.convertError ( "delete" , e ) ; } }
Source:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < java.lang.String , java.util.Set < com.google.gerrit.reviewdb.Account.Id > > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < java.lang.String , java.util.Set < com.google.gerrit.reviewdb.Account.Id > > > ( ) { } ; core ( type , com.google.gerrit.server.account.AccountByEmailCacheImpl.CACHE_NAME ) ; bind ( com.google.gerrit.server.account.AccountByEmailCacheImpl.class ) ; bind ( com.google.gerrit.server.account.AccountByEmailCache.class ) . to ( com.google.gerrit.server.account.AccountByEmailCacheImpl.class ) ; }

Target:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < java.lang.String , java.util.Set < com.google.gerrit.reviewdb.Account.Id > > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < java.lang.String , java.util.Set < com.google.gerrit.reviewdb.Account.Id > > > ( ) { } ; core ( type , com.google.gerrit.server.account.AccountByEmailCacheImpl.CACHE_NAME ) . populateWith ( com.google.gerrit.server.account.AccountByEmailCacheImpl.Loader.class ) ; bind ( com.google.gerrit.server.account.AccountByEmailCacheImpl.class ) ; bind ( com.google.gerrit.server.account.AccountByEmailCache.class ) . to ( com.google.gerrit.server.account.AccountByEmailCacheImpl.class ) ; }
Source:
public com.google.gerrit.server.project.ProjectState get ( final com.google.gerrit.reviewdb.Project.NameKey projectName ) { return byName.get ( projectName ) ; }

Target:
public com.google.gerrit.server.project.ProjectState get ( final com.google.gerrit.reviewdb.Project.NameKey projectName ) { com.google.gerrit.server.project.ProjectState state = byName.get ( projectName ) ; if ( ( state != null ) && ( state.needsRefresh ( generation ) ) ) { byName.remove ( projectName ) ; state = byName.get ( projectName ) ; } return state ; }
Source:
public java.lang.String toString ( ) { final java.lang.StringBuffer r = new java.lang.StringBuffer ( ) ; r.append ( getClass ( ) . getName ( ) ) ; r.append ( '[' ) ; if ( ( getParentKey ( ) ) != null ) { r.append ( getParentKey ( ) . toString ( ) ) ; r.append ( ", " ) ; } r.append ( get ( ) ) ; r.append ( ']' ) ; return r.toString ( ) ; }

Target:
public java.lang.String toString ( ) { final java.lang.StringBuffer r = new java.lang.StringBuffer ( ) ; if ( ( getParentKey ( ) ) != null ) { r.append ( getParentKey ( ) . toString ( ) ) ; r.append ( ',' ) ; } r.append ( com.google.gwtorm.client.KeyUtil.encode ( get ( ) ) ) ; return r.toString ( ) ; }
Source:
private boolean canPerformOnAllRefs ( com.google.gerrit.reviewdb.ApprovalCategory.Id actionId , short requireValue ) { return canPerform ( actionId , requireValue , "refs/*" ) ; }

Target:
private java.util.Set < java.lang.String > allRefPatterns ( com.google.gerrit.reviewdb.ApprovalCategory.Id actionId ) { final java.util.Set < java.lang.String > all = new java.util.HashSet < java.lang.String > ( ) ; for ( final com.google.gerrit.reviewdb.RefRight pr : state.getLocalRights ( actionId ) ) { all.add ( pr.getRefPattern ( ) ) ; } if ( actionId.canInheritFromWildProject ( ) ) { for ( final com.google.gerrit.reviewdb.RefRight pr : state.getInheritedRights ( actionId ) ) { all.add ( pr.getRefPattern ( ) ) ; } } return all ; }
Source:
public void testUnblockInLocalVisibilityByRegisteredUsers_Fails ( ) { com.google.gerrit.server.project.Util.block ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; org.junit.Assert.assertFalse ( "u can't read" , u.controlForRef ( "refs/heads/master" ) . isVisibleByRegisteredUsers ( ) ) ; }

Target:
public void testUnblockInLocalVisibilityByRegisteredUsers_Fails ( ) { com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; org.junit.Assert.assertFalse ( "u can't read" , u.controlForRef ( "refs/heads/master" ) . isVisibleByRegisteredUsers ( ) ) ; }
Source:
private void mapMessages ( com.google.gerrit.server.change.ChangeJson.ChangeInfo i , com.google.gerrit.extensions.common.ChangeInfo o ) { java.util.List < com.google.gerrit.extensions.common.ChangeMessageInfo > r = com.google.common.collect.Lists.newArrayListWithCapacity ( i.messages.size ( ) ) ; for ( com.google.gerrit.server.change.ChangeJson.ChangeMessageInfo m : i.messages ) { com.google.gerrit.extensions.common.ChangeMessageInfo cmi = new com.google.gerrit.extensions.common.ChangeMessageInfo ( ) ; cmi.id = m.id ; cmi.author = com.google.gerrit.server.api.changes.ChangeInfoMapper.fromAcountInfo ( m.author ) ; cmi.date = m.date ; cmi.message = m.message ; cmi._revisionNumber = m._revisionNumber ; r.add ( cmi ) ; } o.messages = r ; }

Target:
private void mapMessages ( com.google.gerrit.server.change.ChangeJson.ChangeInfo i , com.google.gerrit.extensions.common.ChangeInfo o ) { java.util.List < com.google.gerrit.extensions.common.ChangeMessageInfo > r = com.google.common.collect.Lists.newArrayListWithCapacity ( i.messages.size ( ) ) ; for ( com.google.gerrit.server.change.ChangeJson.ChangeMessageInfo m : i.messages ) { com.google.gerrit.extensions.common.ChangeMessageInfo cmi = new com.google.gerrit.extensions.common.ChangeMessageInfo ( ) ; cmi.id = m.id ; cmi.author = com.google.gerrit.server.api.accounts.AccountInfoMapper.fromAcountInfo ( m.author ) ; cmi.date = m.date ; cmi.message = m.message ; cmi._revisionNumber = m._revisionNumber ; r.add ( cmi ) ; } o.messages = r ; }
Source:
public void parseBranch ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Patch-Set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( ( "\n" + "Branch: master\n" ) + "Patch-Set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Branch: refs/heads/stable" ) ) ) ; }

Target:
public void parseTopic ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-Set: 1\n" ) + "Topic: Some Topic\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-Set: 1\n" ) + "Topic:\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Topic: Some Topic\n" ) + "Topic: Other Topic" ) ) ) ; }
Source:
public void testDeleteResponseOK ( ) throws java.lang.Exception { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.delete ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.NO_CONTENT ) ) ) ; com.google.common.truth.Truth.assertThat ( httpSession.delete ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT ) . isSuccessful ( ) ) . isTrue ( ) ; }

Target:
public void testDeleteResponseOK ( ) throws java.lang.Exception { wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.delete ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.NO_CONTENT ) ) ) ; com.google.common.truth.Truth.assertThat ( httpSession.delete ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT ) . isSuccessful ( ) ) . isTrue ( ) ; }
Source:
private static synchronized void fill ( byte [ ] raw , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( ( com.google.gerrit.server.ChangeUtil.uuidSeq ) == 0 ) { com.google.gerrit.server.ChangeUtil.uuidPrefix = db.nextChangeMessageId ( ) ; com.google.gerrit.server.ChangeUtil.uuidSeq = java.lang.Integer.MAX_VALUE ; } org.eclipse.jgit.util.NB.encodeInt32 ( raw , 0 , com.google.gerrit.server.ChangeUtil.uuidPrefix ) ; org.eclipse.jgit.util.NB.encodeInt32 ( raw , 4 , com.google.gerrit.server.util.IdGenerator.mix ( com.google.gerrit.server.ChangeUtil.uuidPrefix , ( ( com.google.gerrit.server.ChangeUtil.uuidSeq ) -- ) ) ) ; }

Target:
public static java.lang.String messageUUID ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { int p ; int s ; synchronized ( com.google.gerrit.server.ChangeUtil.uuidLock ) { if ( ( com.google.gerrit.server.ChangeUtil.uuidSeq ) == 0 ) { com.google.gerrit.server.ChangeUtil.uuidPrefix = db.nextChangeMessageId ( ) ; com.google.gerrit.server.ChangeUtil.uuidSeq = java.lang.Integer.MAX_VALUE ; } p = com.google.gerrit.server.ChangeUtil.uuidPrefix ; s = ( com.google.gerrit.server.ChangeUtil.uuidSeq ) -- ; } java.lang.String u = com.google.gerrit.server.util.IdGenerator.format ( com.google.gerrit.server.util.IdGenerator.mix ( com.google.gerrit.server.ChangeUtil.SEED , p ) ) ; java.lang.String l = com.google.gerrit.server.util.IdGenerator.format ( com.google.gerrit.server.util.IdGenerator.mix ( p , s ) ) ; return ( u + '_' ) + l ; }
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 ) ) ; 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 ) ; }

Target:
public void setUpMocks ( ) { changeId = new com.google.gerrit.reviewdb.client.Change.Id ( com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandlerTest.CHANGE_ID ) ; accountId = new com.google.gerrit.reviewdb.client.Account.Id ( com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandlerTest.ACCOUNT_ID ) ; accountGroupUUID = new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( 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:
protected void configure ( ) { bind ( java.lang.String.class ) . annotatedWith ( com.googlesource.gerrit.plugins.hooks.its.ItsName.class ) . toInstance ( "ItsTestName" ) ; serverConfig = createMock ( org.eclipse.jgit.lib.Config.class ) ; bind ( org.eclipse.jgit.lib.Config.class ) . annotatedWith ( com.google.gerrit.server.config.GerritServerConfig.class ) . toInstance ( serverConfig ) ; issueExtractor = createMock ( com.googlesource.gerrit.plugins.hooks.util.IssueExtractor.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.util.IssueExtractor.class ) . toInstance ( issueExtractor ) ; itsFacade = createMock ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) . toInstance ( itsFacade ) ; }

Target:
protected void configure ( ) { bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.PluginName.class ) . toInstance ( "ItsTestName" ) ; serverConfig = createMock ( org.eclipse.jgit.lib.Config.class ) ; bind ( org.eclipse.jgit.lib.Config.class ) . annotatedWith ( com.google.gerrit.server.config.GerritServerConfig.class ) . toInstance ( serverConfig ) ; issueExtractor = createMock ( com.googlesource.gerrit.plugins.hooks.util.IssueExtractor.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.util.IssueExtractor.class ) . toInstance ( issueExtractor ) ; itsFacade = createMock ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) . toInstance ( itsFacade ) ; }