auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void topoSortCycle ( ) { com.google.gerrit.server.notedb.rebuild.Event e1 = new com.google.gerrit.server.notedb.rebuild.EventSorterTest.TestEvent ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; com.google.gerrit.server.notedb.rebuild.Event e2 = new com.google.gerrit.server.notedb.rebuild.EventSorterTest.TestEvent ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; java.util.List < com.google.gerrit.server.notedb.rebuild.Event > events = events ( e2 , e1 ) ; new com.google.gerrit.server.notedb.rebuild.EventSorter ( events ) . sort ( ) ; com.google.common.truth.Truth.assertThat ( events ) . containsExactly ( e1 , e2 ) . inOrder ( ) ; }

Target:
public void topoSortCycle ( ) { com.google.gerrit.server.notedb.rebuild.Event e1 = new com.google.gerrit.server.notedb.rebuild.EventSorterTest.TestEvent ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; com.google.gerrit.server.notedb.rebuild.Event e2 = new com.google.gerrit.server.notedb.rebuild.EventSorterTest.TestEvent ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; com.google.gerrit.server.notedb.rebuild.EventSorterTest.assertSorted ( com.google.gerrit.server.notedb.rebuild.EventSorterTest.events ( e2 , e1 ) , com.google.gerrit.server.notedb.rebuild.EventSorterTest.events ( e1 , e2 ) ) ; }
Source:
public void getNonExistingCommit_NotFound ( ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = adminSession.get ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/commits/" ) + ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) . name ( ) ) ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_NOT_FOUND , r.getStatusCode ( ) ) ; }

Target:
private com.google.gerrit.extensions.common.CommitInfo getCommit ( org.eclipse.jgit.lib.ObjectId id ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = userSession.get ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/commits/" ) + ( id.name ( ) ) ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; com.google.gerrit.extensions.common.CommitInfo result = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.CommitInfo.class ) ; r.consume ( ) ; return result ; }
Source:
protected void rcptToAuthors ( final com.google.gerrit.server.mail.RecipientType rt ) { for ( final com.google.gerrit.reviewdb.client.Account.Id id : authors ) { add ( rt , id ) ; } }

Target:
protected void bccWatches ( com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType type ) { try { com.google.gerrit.server.mail.ChangeEmail.Watchers matching = getWatches ( type ) ; for ( com.google.gerrit.reviewdb.client.Account.Id user : matching.accounts ) { add ( RecipientType.BCC , user ) ; } for ( com.google.gerrit.server.mail.Address addr : matching.emails ) { add ( RecipientType.BCC , addr ) ; } } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( ( "Cannot BCC watchers for " + type ) , err ) ; } }
Source:
private void runImpl ( ) throws java.io.IOException { org.eclipse.jgit.transport.Transport tn = org.eclipse.jgit.transport.Transport.open ( git , uri ) ; org.eclipse.jgit.transport.PushResult res ; try { res = pushVia ( tn ) ; } finally { try { tn.close ( ) ; } catch ( java.lang.Throwable e2 ) { com.googlesource.gerrit.plugins.replication.PushOne.log.warn ( ( "Unexpected error while closing " + ( uri ) ) , e2 ) ; } } updateStates ( res.getRemoteUpdates ( ) ) ; }

Target:
private void runImpl ( ) throws java.io.IOException { org.eclipse.jgit.transport.Transport tn = org.eclipse.jgit.transport.Transport.open ( git , uri ) ; org.eclipse.jgit.transport.PushResult res ; try { res = pushVia ( tn ) ; } finally { try { tn.close ( ) ; } catch ( java.lang.Throwable e2 ) { com.googlesource.gerrit.plugins.replication.PushOne.repLog.warn ( ( "Unexpected error while closing " + ( uri ) ) , e2 ) ; } } updateStates ( res.getRemoteUpdates ( ) ) ; }
Source:
private void initPatchSet ( ) throws com.google.gwtorm.server.OrmException { if ( ( patchSet ) == null ) { patchSet = cd.currentPatchSet ( ) ; if ( ( patchSet ) == null ) { throw new com.google.gwtorm.server.OrmException ( "No patch set found" ) ; } } }

Target:
private void initChange ( ) throws com.google.gwtorm.server.OrmException { if ( ( control ) == null ) { control = cd.changeControl ( ) ; } if ( ( patchSet ) == null ) { patchSet = cd.currentPatchSet ( ) ; if ( ( patchSet ) == null ) { throw new com.google.gwtorm.server.OrmException ( "No patch set found" ) ; } } }
Source:
public void patchSets ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.reviewdb.client.Change.Id id = r.getPatchSetId ( ) . getParentKey ( ) ; r = amendChange ( r.getChangeId ( ) ) ; checker.checkChanges ( id ) ; }

Target:
public void patchSets ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.reviewdb.client.Change.Id id = r.getPatchSetId ( ) . getParentKey ( ) ; r = amendChange ( r.getChangeId ( ) ) ; checker.rebuildAndCheckChanges ( id ) ; }
Source:
boolean index ( int changeId ) { try { com.ericsson.gerrit.plugins.highavailability.HttpResponseHandler.HttpResult result = httpSession.post ( buildEndpoint ( changeId ) ) ; if ( result.isSuccessful ( ) ) { return true ; } com.ericsson.gerrit.plugins.highavailability.RestSession.log.error ( "Unable to index change {}. Cause: {}" , changeId , result.getMessage ( ) ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.RestSession.log.error ( ( "Error trying to index change " + changeId ) , e ) ; } return false ; }

Target:
public boolean indexChange ( int changeId ) { try { com.ericsson.gerrit.plugins.highavailability.HttpResponseHandler.HttpResult result = httpSession.post ( buildEndpoint ( changeId ) ) ; if ( result.isSuccessful ( ) ) { return true ; } com.ericsson.gerrit.plugins.highavailability.RestEventForwarder.log.error ( "Unable to index change {}. Cause: {}" , changeId , result.getMessage ( ) ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.RestEventForwarder.log.error ( ( "Error trying to index change " + changeId ) , e ) ; } return false ; }
Source:
public void testUpsertOneExisting ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchOK ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 1 ) ; createClassUnderTest ( ) . upsert ( com.google.gwtorm.jdbc.TestJdbcAccess.ONE_ROW ) ; }

Target:
public void testUpsertTwoNotExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 0 , 0 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , 1 , 1 ) ; createClassUnderTest ( ) . upsert ( twoRows ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( insert ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertExpectedIdsUsed ( insert , 1 , 2 ) ; }
Source:
public void onError ( com.google.gwt.http.client.Request req , java.lang.Throwable err ) { RpcStatus.INSTANCE.onRpcComplete ( ) ; if ( err.getMessage ( ) . contains ( "XmlHttpRequest.status" ) ) { cb.onFailure ( new com.google.gwtjsonrpc.client.ServerUnavailableException ( ) ) ; } else { cb.onFailure ( err ) ; } }

Target:
public void onError ( com.google.gwt.http.client.Request req , java.lang.Throwable err ) { RpcStatus.INSTANCE.onRpcComplete ( ) ; if ( err.getMessage ( ) . contains ( "XmlHttpRequest.status" ) ) { cb.onFailure ( new com.google.gwt.user.client.rpc.StatusCodeException ( com.google.gerrit.client.rpc.RestApi.SC_UNAVAILABLE , RpcConstants.C.errorServerUnavailable ( ) ) ) ; } else { cb.onFailure ( new com.google.gwt.user.client.rpc.StatusCodeException ( com.google.gerrit.client.rpc.RestApi.SC_TRANSPORT , err.getMessage ( ) ) ) ; } }
Source:
public void stop ( ) { monitorTimer.cancel ( ) ; session.disconnect ( ) ; available = false ; }

Target:
public void stop ( ) { monitorTimer.cancel ( ) ; publisher.cancel ( ) ; if ( ( publisherThread ) != null ) { try { publisherThread.join ( ) ; } catch ( java.lang.InterruptedException e ) { } } session.disconnect ( ) ; available = false ; }
Source:
private java.lang.String insertCss ( java.lang.String html ) { int p = html.lastIndexOf ( "</head>" ) ; if ( p > 0 ) { java.lang.StringBuilder b = new java.lang.StringBuilder ( ) ; b.append ( html.substring ( 0 , p ) ) ; b.append ( "<style type=\"text/css\">\n" ) ; b.append ( com.googlesource.gerrit.plugins.xdocs.formatter.AsciidoctorFormatter.readCSS ( ) ) ; b.append ( "</style>\n" ) ; b.append ( html.substring ( p ) ) ; return b.toString ( ) ; } else { return html ; } }

Target:
private org.asciidoctor.Attributes getAttributes ( com.googlesource.gerrit.plugins.xdocs.ConfigSection cfg , java.lang.String revision ) { org.asciidoctor.AttributesBuilder ab = org.asciidoctor.AttributesBuilder.attributes ( ) . tableOfContents ( cfg.getBoolean ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig.KEY_INCLUDE_TOC , true ) ) . sourceHighlighter ( "prettify" ) ; for ( java.lang.String name : attributes.stringPropertyNames ( ) ) { ab.attribute ( name , attributes.getProperty ( name ) ) ; } ab.attribute ( "last-update-label!" ) ; ab.attribute ( "revnumber" , revision ) ; return ab.get ( ) ; }
Source:
protected void configureServlets ( ) { rpc ( com.google.gerrit.server.rpc.AccountServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.AccountSecurityImpl.class ) ; rpc ( com.google.gerrit.server.rpc.GroupAdminServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ChangeDetailServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ChangeListServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ChangeManageServiceImpl.class ) ; rpc ( com.google.gerrit.server.patch.PatchDetailServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ProjectAdminServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SuggestServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SystemInfoServiceImpl.class ) ; }

Target:
protected void configureServlets ( ) { rpc ( com.google.gerrit.server.rpc.AccountServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.AccountSecurityImpl.class ) ; rpc ( com.google.gerrit.server.rpc.GroupAdminServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ChangeDetailServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ChangeListServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ChangeManageServiceImpl.class ) ; rpc ( com.google.gerrit.server.patch.PatchDetailServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ProjectAdminServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SuggestServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SystemInfoServiceImpl.class ) ; install ( new com.google.gerrit.server.config.FactoryModule ( ) { @ java.lang.Override protected void configure ( ) { factory ( ChangeDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; } } ) ; }
Source:
private void updateDraft ( java.lang.String changeId , java.lang.String revId , com.google.gerrit.extensions.api.changes.ReviewInput.CommentInput c , java.lang.String uuid ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = userSession.put ( ( ( ( ( ( "/changes/" + changeId ) + "/revisions/" ) + revId ) + "/drafts/" ) + uuid ) , c ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; }

Target:
private void updateDraft ( java.lang.String changeId , java.lang.String revId , com.google.gerrit.extensions.api.changes.DraftInput in , java.lang.String uuid ) throws java.lang.Exception { gApi.changes ( ) . id ( changeId ) . revision ( revId ) . draft ( uuid ) . update ( in ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.dashboards.DashboardInfo result ) { if ( com.google.gerrit.client.Dispatcher.matchPrefix ( "/dashboard/" , result.url ( ) ) ) { java.lang.String rest = com.google.gerrit.client.Dispatcher.skip ( result.url ( ) ) ; com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.changes.CustomDashboardScreen ( rest.substring ( 1 ) ) ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.dashboards.DashboardInfo result ) { if ( com.google.gerrit.client.Dispatcher.matchPrefix ( "/dashboard/" , result.url ( ) ) ) { java.lang.String params = com.google.gerrit.client.Dispatcher.skip ( result.url ( ) ) . substring ( 1 ) ; com.google.gerrit.client.changes.CustomDashboardScreen dash = new com.google.gerrit.client.changes.CustomDashboardScreen ( params ) ; dash.setTitle ( new com.google.gerrit.client.ui.InlineHyperlink ( dash.getTitle ( ) , com.google.gerrit.common.PageLinks.toCustomDashboard ( params ) ) ) ; com.google.gerrit.client.Gerrit.display ( token , dash ) ; } }
Source:
public void createBranchByProjectOwnerCreateReferenceBlocked_Forbidden ( ) throws java.lang.Exception { grantOwner ( ) ; blockCreateReference ( ) ; com.google.gerrit.acceptance.RestResponse r = userSession.put ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches/" ) + ( branch.getShortName ( ) ) ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_FORBIDDEN ) ; }

Target:
public void createBranchByProjectOwner ( ) throws java.lang.Exception { grantOwner ( ) ; setApiUser ( user ) ; assertCreateSucceeds ( ) ; }
Source:
public java.lang.Boolean call ( ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.NoSuchProjectException { return shouldReplicate ( project ) ; }

Target:
public java.lang.Boolean call ( ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.NoSuchProjectException { com.google.gerrit.server.project.ProjectState projectState ; try { projectState = projectCache.checkedGet ( project ) ; } catch ( java.io.IOException e ) { return false ; } if ( projectState == null ) { throw new com.google.gerrit.server.project.NoSuchProjectException ( project ) ; } return shouldReplicate ( projectState , userProvider.get ( ) ) ; }
Source:
public void defaultGpgCertificationMatchesEmail ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithSecondUserId ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = checkerFactory.create ( ) . setExpectedUser ( user ) . disableTrust ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , ( "Key must contain a valid certification for one of the following " + ( ( "identities:\n" + " gerrit:user\n" ) + " username:user" ) ) ) ; addExternalId ( "test" , "test" , "test5@example.com" ) ; checker = checkerFactory.create ( ) . setExpectedUser ( user ) . disableTrust ( ) ; assertNoProblems ( checker.check ( key.getPublicKey ( ) ) ) ; }

Target:
public void defaultGpgCertificationMatchesEmail ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithSecondUserId ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = checkerFactory.create ( user , store ) . disableTrust ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , ( "Key must contain a valid certification for one of the following " + ( ( "identities:\n" + " gerrit:user\n" ) + " username:user" ) ) ) ; addExternalId ( "test" , "test" , "test5@example.com" ) ; checker = checkerFactory.create ( user , store ) . disableTrust ( ) ; assertNoProblems ( checker.check ( key.getPublicKey ( ) ) ) ; }
Source:
public void onGitReferenceUpdated ( com.google.gerrit.extensions.events.GitReferenceUpdatedListener.Event event ) { com.googlesource.gerrit.plugins.hooks.HookArgs args = hookFactory.createArgs ( ) ; args.add ( "--oldrev" , event.getOldObjectId ( ) ) ; args.add ( "--newrev" , event.getNewObjectId ( ) ) ; args.add ( "--refname" , event.getRefName ( ) ) ; args.add ( "--project" , event.getProjectName ( ) ) ; args.add ( "--submitter" , event.getUpdater ( ) ) ; hook.submit ( event.getProjectName ( ) , args ) ; }

Target:
public void onGitReferenceUpdated ( com.google.gerrit.extensions.events.GitReferenceUpdatedListener.Event event ) { com.googlesource.gerrit.plugins.hooks.HookArgs args = hookFactory.createArgs ( ) ; args.add ( "--oldrev" , event.getOldObjectId ( ) ) ; args.add ( "--newrev" , event.getNewObjectId ( ) ) ; args.add ( "--refname" , event.getRefName ( ) ) ; args.add ( "--project" , event.getProjectName ( ) ) ; args.add ( "--submitter" , event.getUpdater ( ) ) ; hook.execute ( event.getProjectName ( ) , args ) ; }
Source:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.git.validators.CommitValidationListener.class ) . to ( com.googlesource.gerrit.plugins.uploadvalidator.FooterValidator.class ) ; bind ( com.google.gerrit.server.config.ProjectConfigEntry.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( com.googlesource.gerrit.plugins.uploadvalidator.FooterValidator.KEY_REQUIRED_FOOTER ) ) . toInstance ( new com.google.gerrit.server.config.ProjectConfigEntry ( "Required Footers" , null , ProjectConfigEntry.Type.ARRAY , null , false , ( "Required footers. Pushes of commits that miss any" + " of the footers will be rejected." ) ) ) ; }

Target:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.git.validators.CommitValidationListener.class ) . to ( com.googlesource.gerrit.plugins.uploadvalidator.FooterValidator.class ) ; bind ( com.google.gerrit.server.config.ProjectConfigEntry.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( com.googlesource.gerrit.plugins.uploadvalidator.FooterValidator.KEY_REQUIRED_FOOTER ) ) . toInstance ( new com.google.gerrit.server.config.ProjectConfigEntry ( "Required Footers" , null , com.google.gerrit.extensions.api.projects.ProjectConfigEntryType.ARRAY , null , false , ( "Required footers. Pushes of commits that miss any" + " of the footers will be rejected." ) ) ) ; }
Source:
public java.util.SortedSet < java.lang.String > getStars ( java.lang.String changeId ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.account.AccountResource.Star rsrc = stars.parse ( account , com.google.gerrit.extensions.restapi.IdString.fromUrl ( changeId ) ) ; return starsGet.apply ( rsrc ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot get stars" , e ) ; } }

Target:
public java.util.SortedSet < java.lang.String > getStars ( java.lang.String changeId ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.account.AccountResource.Star rsrc = stars.parse ( account , com.google.gerrit.extensions.restapi.IdString.fromUrl ( changeId ) ) ; return starsGet.apply ( rsrc ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot get stars" , e ) ; } }
Source:
public static java.lang.String getMagicRefNamePrefix ( java.lang.String refName ) { if ( refName.startsWith ( com.google.gerrit.server.util.MagicBranch.NEW_DRAFT_CHANGE ) ) { return com.google.gerrit.server.util.MagicBranch.NEW_DRAFT_CHANGE ; } if ( refName.startsWith ( com.google.gerrit.server.util.MagicBranch.NEW_CHANGE ) ) { return com.google.gerrit.server.util.MagicBranch.NEW_CHANGE ; } return null ; }

Target:
public static java.lang.String getMagicRefNamePrefix ( java.lang.String refName ) { if ( refName.startsWith ( com.google.gerrit.server.util.MagicBranch.NEW_DRAFT_CHANGE ) ) { return com.google.gerrit.server.util.MagicBranch.NEW_DRAFT_CHANGE ; } if ( refName.startsWith ( com.google.gerrit.server.util.MagicBranch.NEW_PUBLISH_CHANGE ) ) { return com.google.gerrit.server.util.MagicBranch.NEW_PUBLISH_CHANGE ; } if ( refName.startsWith ( com.google.gerrit.server.util.MagicBranch.NEW_CHANGE ) ) { return com.google.gerrit.server.util.MagicBranch.NEW_CHANGE ; } return null ; }
Source:
private static com.google.gerrit.server.mail.send.CommentFormatter.Block makeQuote ( java.lang.String p ) { if ( p.startsWith ( "> " ) ) { p = p.substring ( 2 ) ; } else if ( p.startsWith ( " > " ) ) { p = p.substring ( 3 ) ; } com.google.gerrit.server.mail.send.CommentFormatter.Block block = new com.google.gerrit.server.mail.send.CommentFormatter.Block ( ) ; block.type = com.google.gerrit.server.mail.send.CommentFormatter.BlockType.QUOTE ; block.text = p.replaceAll ( "\n\\s?>\\s" , "\n" ) . trim ( ) ; return block ; }

Target:
private static com.google.gerrit.server.mail.send.CommentFormatter.Block makeQuote ( java.lang.String p ) { java.lang.String quote = p.replaceAll ( "\n\\s?>\\s?" , "\n" ) ; if ( quote.startsWith ( "> " ) ) { quote = quote.substring ( 2 ) ; } else if ( quote.startsWith ( " > " ) ) { quote = quote.substring ( 3 ) ; } com.google.gerrit.server.mail.send.CommentFormatter.Block block = new com.google.gerrit.server.mail.send.CommentFormatter.Block ( ) ; block.type = com.google.gerrit.server.mail.send.CommentFormatter.BlockType.QUOTE ; block.quotedBlocks = com.google.gerrit.server.mail.send.CommentFormatter.parse ( quote ) ; return block ; }
Source:
public void onTopicEdited ( com.google.gerrit.extensions.events.TopicEditedListener.Event ev ) { try { com.google.gerrit.reviewdb.client.Change change = getChange ( ev.getChange ( ) ) ; com.google.gerrit.server.events.TopicChangedEvent event = new com.google.gerrit.server.events.TopicChangedEvent ( change ) ; event.change = changeAttributeSupplier ( change ) ; event.changer = accountAttributeSupplier ( ev.getEditor ( ) ) ; event.oldTopic = ev.getOldTopic ( ) ; dispatcher.get ( ) . postEvent ( change , event ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.events.StreamEventsApiListener.log.error ( "Failed to dispatch event" , e ) ; } }

Target:
public void onTopicEdited ( com.google.gerrit.extensions.events.TopicEditedListener.Event ev ) { try { com.google.gerrit.reviewdb.client.Change change = getChange ( ev.getChange ( ) ) ; com.google.gerrit.server.events.TopicChangedEvent event = new com.google.gerrit.server.events.TopicChangedEvent ( change ) ; event.change = changeAttributeSupplier ( change ) ; event.changer = accountAttributeSupplier ( ev.getWho ( ) ) ; event.oldTopic = ev.getOldTopic ( ) ; dispatcher.get ( ) . postEvent ( change , event ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.events.StreamEventsApiListener.log.error ( "Failed to dispatch event" , e ) ; } }
Source:
public com.google.gerrit.httpd.rpc.changedetail.Change update ( com.google.gerrit.httpd.rpc.changedetail.Change change ) { if ( ( ( change.getStatus ( ) ) == ( Change.Status.ABANDONED ) ) && ( change.currentPatchSetId ( ) . equals ( patchSetId ) ) ) { change.setStatus ( Change.Status.NEW ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; return change ; } else { return null ; } }

Target:
public com.google.gerrit.common.data.ChangeDetail call ( ) throws com.google.gerrit.common.errors.NoSuchEntityException , com.google.gerrit.server.mail.EmailException , com.google.gerrit.server.patch.PatchSetInfoNotAvailableException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.client.OrmException { final com.google.gerrit.httpd.rpc.changedetail.Change.Id changeId = patchSetId.getParentKey ( ) ; final com.google.gerrit.server.project.ChangeControl control = changeControlFactory.validateFor ( changeId ) ; if ( ! ( control.canRestore ( ) ) ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } com.google.gerrit.server.ChangeUtil.restore ( patchSetId , currentUser , message , db , abandonedSenderFactory , hooks ) ; return changeDetailFactory.create ( changeId ) . call ( ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.Rebuild.Input input ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ! ( migration.writeChanges ( ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } try { rebuilder.rebuild ( db.get ( ) , rsrc.getId ( ) ) ; } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( com.google.gerrit.extensions.restapi.IdString.fromDecoded ( rsrc.getId ( ) . toString ( ) ) ) ; } return com.google.gerrit.extensions.restapi.Response.none ( ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.Rebuild.Input input ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ! ( migration.commitChangeWrites ( ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } try { rebuilder.rebuild ( db.get ( ) , rsrc.getId ( ) ) ; } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( com.google.gerrit.extensions.restapi.IdString.fromDecoded ( rsrc.getId ( ) . toString ( ) ) ) ; } return com.google.gerrit.extensions.restapi.Response.none ( ) ; }
Source:
void addLabel ( final java.lang.String token ) throws org.kohsuke.args4j.CmdLineException { com.google.gerrit.server.util.LabelVote v = com.google.gerrit.server.util.LabelVote.parse ( token ) ; try { com.google.gerrit.common.data.LabelType.checkName ( v.getLabel ( ) ) ; com.google.gerrit.server.ApprovalsUtil.checkLabel ( labelTypes , v.getLabel ( ) , v.getValue ( ) ) ; } catch ( java.lang.IllegalArgumentException e ) { throw clp.reject ( e.getMessage ( ) ) ; } labels.put ( v.getLabel ( ) , v.getValue ( ) ) ; }

Target:
void addMessage ( final java.lang.String token ) { message = token.replace ( "_" , " " ) ; }
Source:
public java.lang.Object login ( boolean quiet ) { try { java.lang.String token = client.login ( getUsername ( ) , getPassword ( ) ) ; log.info ( ( ( ( "Connected to " + ( getUrl ( ) ) ) + " as " ) + token ) ) ; return token ; } catch ( java.lang.Exception ex ) { if ( ! quiet ) { log.error ( "I was unable to logout" , ex ) ; } return null ; } }

Target:
public java.lang.Object login ( boolean quiet ) { try { java.lang.String token = client.login ( getUsername ( ) , getPassword ( ) ) ; log.info ( ( ( ( "Connected to " + ( getUrl ( ) ) ) + " as " ) + token ) ) ; return token ; } catch ( java.lang.Exception ex ) { if ( ! quiet ) { log.error ( "I was unable to login" , ex ) ; } return null ; } }
Source:
public void update ( int completed ) { if ( ( totUnits ) == 0 ) { return ; } currUnit += completed ; int percentage = ( ( currUnit ) * 100 ) / ( totUnits ) ; if ( percentage > ( lastPercentage ) ) { lastPercentage = percentage ; } }

Target:
public void update ( int completed ) { if ( ( totUnits ) == 0 ) { return ; } currUnit += completed ; int percentage = ( ( currUnit ) * 100 ) / ( totUnits ) ; if ( percentage > ( lastPercentage ) ) { lastPercentage = percentage ; } status.update ( Code.SYNC , status.getShortDescription ( ) , getStatusDescription ( ) ) ; }
Source:
private void markInvalid ( final com.google.gerrit.reviewdb.server.ReviewDb db , final com.google.gerrit.reviewdb.client.AccountSshKey k ) { try { com.google.gerrit.sshd.SshKeyCacheImpl.log.info ( ( ( "Flagging SSH key " + ( k.getKey ( ) ) ) + " invalid" ) ) ; k.setInvalid ( ) ; db.accountSshKeys ( ) . update ( java.util.Collections.singleton ( k ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.sshd.SshKeyCacheImpl.log.error ( ( ( "Failed to mark SSH key" + ( k.getKey ( ) ) ) + " invalid" ) , e ) ; } }

Target:
private void markInvalid ( com.google.gerrit.reviewdb.client.AccountSshKey k ) { try { com.google.gerrit.sshd.SshKeyCacheImpl.log.info ( ( ( "Flagging SSH key " + ( k.getKey ( ) ) ) + " invalid" ) ) ; authorizedKeys.markKeyInvalid ( k.getAccount ( ) , k.getKey ( ) . get ( ) ) ; k.setInvalid ( ) ; } catch ( java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException e ) { com.google.gerrit.sshd.SshKeyCacheImpl.log.error ( ( ( "Failed to mark SSH key" + ( k.getKey ( ) ) ) + " invalid" ) , e ) ; } }
Source:
public void noRescheduleOnSuccess ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.WEBHOOK_URL , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.BODY ) ) . thenReturn ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.OK_RESULT ) ; task.run ( ) ; org.mockito.Mockito.verifyZeroInteractions ( executor ) ; }

Target:
public void noRescheduleOnSuccess ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( org.mockito.ArgumentMatchers.eq ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.WEBHOOK_URL ) , org.mockito.ArgumentMatchers.eq ( content ) ) ) . thenReturn ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.OK_RESULT ) ; task.run ( ) ; org.mockito.Mockito.verifyZeroInteractions ( executor ) ; }
Source:
private void computeAllowed ( ) { final com.google.gerrit.client.reviewdb.Account.Id me = com.google.gerrit.client.rpc.Common.getAccountId ( ) ; final java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > am = com.google.gerrit.client.rpc.Common.getGroupCache ( ) . getEffectiveGroups ( me ) ; final com.google.gerrit.client.data.ProjectCache.Entry pe = com.google.gerrit.client.rpc.Common.getProjectCache ( ) . get ( change.getDest ( ) . getParentKey ( ) ) ; computeAllowed ( am , pe.getRights ( ) ) ; computeAllowed ( am , com.google.gerrit.client.rpc.Common.getProjectCache ( ) . getWildcardRights ( ) ) ; }

Target:
private void computeAllowed ( ) { final com.google.gerrit.client.reviewdb.Account.Id me = com.google.gerrit.client.rpc.Common.getAccountId ( ) ; final java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > am = com.google.gerrit.client.rpc.Common.getGroupCache ( ) . getEffectiveGroups ( me ) ; final com.google.gerrit.server.project.ProjectState pe = projectCache.get ( change.getDest ( ) . getParentKey ( ) ) ; computeAllowed ( am , pe.getRights ( ) ) ; computeAllowed ( am , projectCache.getWildcardRights ( ) ) ; }
Source:
public java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > byPatchSetUser ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.reviewdb.client.PatchSet.Id psId , com.google.gerrit.reviewdb.client.Account.Id accountId ) throws com.google.gwtorm.server.OrmException { if ( ! ( migration.readPatchSetApprovals ( ) ) ) { return com.google.gerrit.server.ApprovalsUtil.sortApprovals ( db.patchSetApprovals ( ) . byPatchSetUser ( psId , accountId ) ) ; } return com.google.common.collect.ImmutableList.copyOf ( com.google.gerrit.server.ApprovalsUtil.filterApprovals ( byPatchSet ( db , notes , psId ) , accountId ) ) ; }

Target:
public java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > byPatchSetUser ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet.Id psId , com.google.gerrit.reviewdb.client.Account.Id accountId ) throws com.google.gwtorm.server.OrmException { if ( ! ( migration.readPatchSetApprovals ( ) ) ) { return com.google.gerrit.server.ApprovalsUtil.sortApprovals ( db.patchSetApprovals ( ) . byPatchSetUser ( psId , accountId ) ) ; } return com.google.gerrit.server.ApprovalsUtil.filterApprovals ( byPatchSet ( db , ctl , psId ) , accountId ) ; }
Source:
static void link ( com.google.gerrit.client.diff.PaddingManager a , com.google.gerrit.client.diff.PaddingManager b ) { if ( ! ( a.others.contains ( b ) ) ) { a.others.add ( b ) ; } if ( ! ( b.others.contains ( a ) ) ) { b.others.add ( a ) ; } }

Target:
static void link ( com.google.gerrit.client.diff.PaddingManager a , com.google.gerrit.client.diff.PaddingManager b ) { a.other = b ; b.other = a ; }
Source:
public void onSuccess ( com.google.gerrit.client.config.ServerInfo info ) { com.google.gerrit.client.Gerrit.myServerInfo = info ; java.lang.String du = info.gerrit ( ) . docUrl ( ) ; if ( ( du != null ) && ( ! ( du.isEmpty ( ) ) ) ) { com.google.gerrit.client.Gerrit.hasDocumentation = true ; com.google.gerrit.client.Gerrit.docUrl = du ; } }

Target:
public void onSuccess ( com.google.gerrit.client.config.ServerInfo info ) { com.google.gerrit.client.Gerrit.myServerInfo = info ; com.google.gerrit.client.Gerrit.urlAliasMatcher = new com.google.gerrit.client.UrlAliasMatcher ( info.urlAliases ( ) ) ; java.lang.String du = info.gerrit ( ) . docUrl ( ) ; if ( ( du != null ) && ( ! ( du.isEmpty ( ) ) ) ) { com.google.gerrit.client.Gerrit.hasDocumentation = true ; com.google.gerrit.client.Gerrit.docUrl = du ; } }
Source:
public void assertHasNoPackFile ( com.google.gerrit.reviewdb.client.Project ... projects ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { for ( com.google.gerrit.reviewdb.client.Project.NameKey p : projects ) { com.google.common.truth.Truth.assert_ ( ) . withMessage ( ( ( "Project " + ( p.get ( ) ) ) + " has pack files." ) ) . that ( getPackFiles ( p ) ) . isEmpty ( ) ; } }

Target:
public void assertHasNoPackFile ( com.google.gerrit.reviewdb.client.Project ... projects ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { for ( com.google.gerrit.reviewdb.client.Project.NameKey p : projects ) { com.google.common.truth.Truth.assertWithMessage ( ( ( "Project " + ( p.get ( ) ) ) + " has pack files." ) ) . that ( getPackFiles ( p ) ) . isEmpty ( ) ; } }
Source:
protected void display ( com.googlesource.gerrit.plugins.imagare.client.ConfigInfo info ) { com.google.gwt.user.client.ui.HorizontalPanel p = new com.google.gwt.user.client.ui.HorizontalPanel ( ) ; p.setStyleName ( "imagare-menu-panel" ) ; com.google.gwt.user.client.ui.Anchor prefsAnchor = new com.google.gwt.user.client.ui.Anchor ( new com.google.gwt.user.client.ui.ImageResourceRenderer ( ) . render ( ImagarePlugin.RESOURCES.image ( ) ) , ( ( "#/x/" + ( com.google.gerrit.plugin.client.Plugin.get ( ) . getPluginName ( ) ) ) + "/upload" ) ) ; prefsAnchor.setTitle ( "Upload Image" ) ; p.add ( prefsAnchor ) ; add ( p ) ; super . display ( info ) ; }

Target:
protected void display ( com.googlesource.gerrit.plugins.imagare.client.ConfigInfo info ) { if ( enableImageServer ) { com.google.gwt.user.client.ui.HorizontalPanel p = new com.google.gwt.user.client.ui.HorizontalPanel ( ) ; p.setStyleName ( "imagare-menu-panel" ) ; com.google.gwt.user.client.ui.Anchor uploadAnchor = new com.google.gwt.user.client.ui.Anchor ( new com.google.gwt.user.client.ui.ImageResourceRenderer ( ) . render ( ImagarePlugin.RESOURCES.image ( ) ) , ( ( "#/x/" + ( com.google.gerrit.plugin.client.Plugin.get ( ) . getPluginName ( ) ) ) + "/upload" ) ) ; uploadAnchor.setTitle ( "Upload Image" ) ; p.add ( uploadAnchor ) ; add ( p ) ; } super . display ( info ) ; }
Source:
public static void createChange ( java.lang.String project , java.lang.String branch , java.lang.String subject , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.CreateChangeInput input = com.google.gerrit.client.changes.ChangeApi.CreateChangeInput.create ( ) ; input.project ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( project ) ) ; input.branch ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( branch ) ) ; input.subject ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( subject ) ) ; new com.google.gerrit.client.rpc.RestApi ( "/changes/" ) . post ( input , cb ) ; }

Target:
public static void createChange ( java.lang.String project , java.lang.String branch , java.lang.String subject , java.lang.String base , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.CreateChangeInput input = com.google.gerrit.client.changes.ChangeApi.CreateChangeInput.create ( ) ; input.project ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( project ) ) ; input.branch ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( branch ) ) ; input.subject ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( subject ) ) ; input.base_change ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( base ) ) ; new com.google.gerrit.client.rpc.RestApi ( "/changes/" ) . post ( input , cb ) ; }
Source:
public void run ( ) { java.lang.String n = com.google.gwt.user.client.Window.prompt ( EditConstants.I.gotoLineNumber ( ) , "" ) ; if ( n != null ) { try { int line = java.lang.Integer.parseInt ( n ) ; line -- ; if ( line >= 0 ) { cm.scrollToLine ( line ) ; } } catch ( java.lang.NumberFormatException e ) { } } }

Target:
public void run ( ) { cm.execCommand ( "jumpToLine" ) ; }
Source:
private boolean matches ( final java.lang.String p , final com.google.gerrit.reviewdb.AccountExternalId id ) { if ( ( p.startsWith ( "^" ) ) && ( p.endsWith ( "$" ) ) ) { return id.getExternalId ( ) . matches ( p ) ; } else { return id.getExternalId ( ) . startsWith ( p ) ; } }

Target:
private static java.util.List < com.google.gerrit.common.auth.openid.OpenIdProviderPattern > toPatterns ( org.eclipse.jgit.lib.Config cfg , java.lang.String name ) { java.lang.String [ ] s = cfg.getStringList ( "auth" , null , name ) ; if ( ( s.length ) == 0 ) { s = new java.lang.String [ ] { "http://" , "https://" } ; } java.util.List < com.google.gerrit.common.auth.openid.OpenIdProviderPattern > r = new java.util.ArrayList < com.google.gerrit.common.auth.openid.OpenIdProviderPattern > ( ) ; for ( java.lang.String pattern : s ) { r.add ( com.google.gerrit.common.auth.openid.OpenIdProviderPattern.create ( pattern ) ) ; } return java.util.Collections.unmodifiableList ( r ) ; }
Source:
public com.google.gitiles.GitilesView.Builder copyFrom ( com.google.gitiles.GitilesView other ) { hostName = other.hostName ; servletPath = other.servletPath ; switch ( type ) { case LOG : case DIFF : oldRevision = other.oldRevision ; case PATH : path = other.path ; case REVISION : revision = other.revision ; case DESCRIBE : case REFS : case REPOSITORY_INDEX : repositoryName = other.repositoryName ; default : break ; } return this ; }

Target:
public com.google.gitiles.GitilesView.Builder copyFrom ( com.google.gitiles.GitilesView other ) { hostName = other.hostName ; servletPath = other.servletPath ; switch ( type ) { case LOG : case DIFF : oldRevision = other.oldRevision ; case PATH : path = other.path ; case REVISION : case ARCHIVE : revision = other.revision ; case DESCRIBE : case REFS : case REPOSITORY_INDEX : repositoryName = other.repositoryName ; default : break ; } if ( ( type ) == ( com.google.gitiles.GitilesView.Type.ARCHIVE ) ) { extension = other.extension ; } return this ; }
Source:
public void listBranchesOfNonVisibleProject_NotFound ( ) throws java.lang.Exception { blockRead ( project , "refs/*" ) ; setApiUser ( user ) ; try { gApi.projects ( ) . name ( project.get ( ) ) . branches ( ) . get ( ) ; org.junit.Assert.fail ( "Expected ResourceNotFoundException" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceNotFoundException expected ) { } }

Target:
public void listBranchesOfNonVisibleProject_NotFound ( ) throws java.lang.Exception { blockRead ( project , "refs/*" ) ; setApiUser ( user ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; gApi.projects ( ) . name ( project.get ( ) ) . branches ( ) . get ( ) ; }
Source:
public void skipOnlyOnSpecificRef ( ) throws java.lang.Exception { java.lang.String config = "[plugin \"uploadvalidator\"]\n" + ( ( "skipValidation=testOp\n" + "skipRef=refs/heads/myref\n" ) + "skipGroup=testGroup" ) ; com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig validatorConfig = new com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig ( new com.googlesource.gerrit.plugins.uploadvalidator.FakeConfigFactory ( projectName , config ) , new com.googlesource.gerrit.plugins.uploadvalidator.FakeGroupCacheUUIDByName ( ) ) ; com.google.common.truth.Truth.assertThat ( validatorConfig.isEnabledForRef ( new com.googlesource.gerrit.plugins.uploadvalidator.FakeUserProvider ( "testGroup" ) . get ( ) , projectName , "refs/heads/myref" , "testOp" ) ) . isFalse ( ) ; }

Target:
public void skipOnlyOnSpecificRef ( ) throws java.lang.Exception { java.lang.String config = "[plugin \"uploadvalidator\"]\n" + ( ( "skipValidation=testOp\n" + "skipRef=refs/heads/myref\n" ) + "skipGroup=testGroup" ) ; com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig validatorConfig = new com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig ( new com.googlesource.gerrit.plugins.uploadvalidator.FakeConfigFactory ( projectName , config ) , new com.googlesource.gerrit.plugins.uploadvalidator.FakeGroupByNameFinder ( ) ) ; com.google.common.truth.Truth.assertThat ( validatorConfig.isEnabledForRef ( new com.googlesource.gerrit.plugins.uploadvalidator.FakeUserProvider ( "testGroup" ) . get ( ) , projectName , "refs/heads/myref" , "testOp" ) ) . isFalse ( ) ; }
Source:
public void index ( com.google.gerrit.reviewdb.client.Account.Id id ) throws java.io.IOException { for ( com.google.gerrit.index.Index < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.server.account.AccountState > i : getWriteIndexes ( ) ) { java.util.Optional < com.google.gerrit.server.account.AccountState > accountState = byIdCache.get ( id ) ; if ( accountState.isPresent ( ) ) { i.replace ( accountState.get ( ) ) ; } else { i.delete ( id ) ; } } fireAccountIndexedEvent ( id.get ( ) ) ; com.google.gerrit.server.index.account.AccountIndexerImpl.autoReindexIfStale ( id ) ; }

Target:
public void index ( com.google.gerrit.reviewdb.client.Account.Id id ) throws java.io.IOException { for ( com.google.gerrit.index.Index < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.server.account.AccountState > i : getWriteIndexes ( ) ) { byIdCache.evict ( id ) ; java.util.Optional < com.google.gerrit.server.account.AccountState > accountState = byIdCache.get ( id ) ; if ( accountState.isPresent ( ) ) { i.replace ( accountState.get ( ) ) ; } else { i.delete ( id ) ; } } fireAccountIndexedEvent ( id.get ( ) ) ; com.google.gerrit.server.index.account.AccountIndexerImpl.autoReindexIfStale ( id ) ; }
Source:
void display ( final java.util.List < com.google.gerrit.reviewdb.Branch > result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.reviewdb.Branch k : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , k ) ; } }

Target:
void display ( final java.util.List < com.google.gerrit.reviewdb.Branch > result ) { canDelete = false ; while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.reviewdb.Branch k : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , k ) ; } }
Source:
public void testReplaceTwoLinks ( ) { com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.html ( "A\nissue 42\nissue 9918\nB" ) ; com.google.gwtexpui.safehtml.client.SafeHtml n = o.replaceAll ( com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.repls ( new com.google.gwtexpui.safehtml.client.RawFindReplace ( "(issue\\s(\\d+))" , "<a href=\"?$2\">$1</a>" ) ) ) ; org.junit.Assert.assertNotSame ( o , n ) ; org.junit.Assert.assertEquals ( ( "A\n" + ( ( "<a href=\"?42\">issue 42</a>\n" + "<a href=\"?9918\">issue 9918</a>\n" ) + "B" ) ) , n.asString ( ) ) ; }

Target:
public void testReplaceTwoLinks ( ) { com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.html ( "A\nissue 42\nissue 9918\nB" ) ; com.google.gwtexpui.safehtml.client.SafeHtml n = o.replaceAll ( com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.repls ( new com.google.gwtexpui.safehtml.client.RawFindReplace ( "(issue\\s(\\d+))" , "<a href=\"?$2\">$1</a>" ) ) ) ; com.google.common.truth.Truth.assertThat ( o ) . isNotSameAs ( n ) ; com.google.common.truth.Truth.assertThat ( n.asString ( ) ) . isEqualTo ( ( "A\n" + ( ( "<a href=\"?42\">issue 42</a>\n" + "<a href=\"?9918\">issue 9918</a>\n" ) + "B" ) ) ) ; }
Source:
HEAD ( com.google.gerrit.httpd.da2e26 Merge ) { }

Target:
private com.google.inject.Key < javax.servlet.http.HttpServlet > gerritUrl ( ) { return key ( new javax.servlet.http.HttpServlet ( ) { private static final long serialVersionUID = 1L ; @ java.lang.Override protected void doGet ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { com.google.gerrit.httpd.UrlModule.toGerrit ( req.getRequestURI ( ) . substring ( req.getContextPath ( ) . length ( ) ) , req , rsp ) ; } } ) ; }
Source:
public synchronized void stop ( ) { if ( ( acceptor ) != null ) { try { acceptor.dispose ( ) ; com.google.gerrit.sshd.SshDaemon.log.info ( "Stopped Gerrit SSHD" ) ; } finally { acceptor = null ; } } }

Target:
public synchronized void stop ( ) { if ( ( acceptor ) != null ) { try { acceptor.close ( true ) . await ( ) ; com.google.gerrit.sshd.SshDaemon.log.info ( "Stopped Gerrit SSHD" ) ; } catch ( java.lang.InterruptedException e ) { com.google.gerrit.sshd.SshDaemon.log.warn ( "Exception caught while closing" , e ) ; } finally { acceptor = null ; } } }
Source:
public boolean match ( com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { try { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p = com.google.gerrit.server.query.Predicate.and ( new com.google.gerrit.server.query.change.LegacyChangeIdPredicate ( object.getId ( ) ) , this ) ; for ( com.google.gerrit.server.query.change.ChangeData cData : index.getSource ( p , com.google.gerrit.server.index.change.IndexedChangeQuery.oneResult ( ) ) . read ( ) ) { if ( cData.getId ( ) . equals ( object.getId ( ) ) ) { return true ; } } } catch ( com.google.gerrit.index.query.QueryParseException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } return false ; }

Target:
public boolean match ( com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { try { com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p = com.google.gerrit.index.query.Predicate.and ( new com.google.gerrit.server.query.change.LegacyChangeIdPredicate ( object.getId ( ) ) , this ) ; for ( com.google.gerrit.server.query.change.ChangeData cData : index.getSource ( p , com.google.gerrit.server.index.change.IndexedChangeQuery.oneResult ( ) ) . read ( ) ) { if ( cData.getId ( ) . equals ( object.getId ( ) ) ) { return true ; } } } catch ( com.google.gerrit.index.query.QueryParseException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } return false ; }
Source:
private static java.lang.String formatChangeUrl ( java.lang.String url , com.google.gerrit.reviewdb.client.Change change ) { java.lang.StringBuilder m = new java.lang.StringBuilder ( ) . append ( " " ) . append ( url ) . append ( change.getChangeId ( ) ) ; if ( ( change.getStatus ( ) ) == ( Change.Status.DRAFT ) ) { m.append ( " [DRAFT]" ) ; } return m.toString ( ) ; }

Target:
private static java.lang.String formatChangeUrl ( java.lang.String url , com.google.gerrit.reviewdb.client.Change change ) { java.lang.StringBuilder m = new java.lang.StringBuilder ( ) . append ( " " ) . append ( url ) . append ( change.getChangeId ( ) ) . append ( " " ) . append ( com.google.gerrit.server.ChangeUtil.cropSubject ( change.getSubject ( ) ) ) ; if ( ( change.getStatus ( ) ) == ( Change.Status.DRAFT ) ) { m.append ( " [DRAFT]" ) ; } return m.toString ( ) ; }