auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean accept ( java.nio.file.Path entry ) throws java.io.IOException { java.lang.String n = entry.getFileName ( ) . toString ( ) ; boolean accept = ( ( ! ( n.startsWith ( ".last_" ) ) ) && ( ! ( n.startsWith ( ".next_" ) ) ) ) && ( java.nio.file.Files.isRegularFile ( entry ) ) ; if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( suffix ) ) ) { accept &= n.endsWith ( suffix ) ; } return accept ; }

Target:
private java.lang.String getPluginCanonicalWebUrl ( java.lang.String name ) { java.lang.String canonicalWebUrl = urlProvider.get ( ) ; if ( com.google.common.base.Strings.isNullOrEmpty ( canonicalWebUrl ) ) { return "/plugins/" + name ; } java.lang.String url = java.lang.String.format ( "%s/plugins/%s/" , com.google.common.base.CharMatcher.is ( '/' ) . trimTrailingFrom ( canonicalWebUrl ) , name ) ; return url ; }
Source:
public void onScreenLoad ( com.google.gerrit.client.ui.ScreenLoadEvent event ) { if ( event.getScreen ( ) . getToken ( ) . equals ( getTargetHistoryToken ( ) ) ) { addStyleName ( Gerrit.RESOURCES.css ( ) . activeRow ( ) ) ; } else { removeStyleName ( Gerrit.RESOURCES.css ( ) . activeRow ( ) ) ; } }

Target:
protected boolean match ( java.lang.String token ) { return token.equals ( getTargetHistoryToken ( ) ) ; }
Source:
public void start ( final org.apache.sshd.server.Environment env ) throws java.io.IOException { try { parseCommandLine ( ) ; } catch ( com.google.gerrit.sshd.commands.UnloggedFailure e ) { java.lang.String msg = e.getMessage ( ) ; if ( ! ( msg.endsWith ( "\n" ) ) ) { msg += "\n" ; } err.write ( msg.getBytes ( "UTF-8" ) ) ; err.flush ( ) ; onExit ( 1 ) ; return ; } stdout = toPrintWriter ( out ) ; source.addEventListener ( listener , currentUser ) ; }

Target:
public void start ( final org.apache.sshd.server.Environment env ) throws java.io.IOException { try { parseCommandLine ( ) ; } catch ( com.google.gerrit.sshd.commands.UnloggedFailure e ) { java.lang.String msg = e.getMessage ( ) ; if ( ! ( msg.endsWith ( "\n" ) ) ) { msg += "\n" ; } err.write ( msg.getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; err.flush ( ) ; onExit ( 1 ) ; return ; } stdout = toPrintWriter ( out ) ; source.addEventListener ( listener , currentUser ) ; }
Source:
private void setupCommonMocks ( ) { org.easymock.EasyMock.expect ( issueExtractor.getPattern ( ) ) . andReturn ( java.util.regex.Pattern.compile ( "bug#(\\d+)" ) ) . anyTimes ( ) ; }

Target:
private void setupCommonMocks ( ) { org.easymock.EasyMock.expect ( itsConfig.getIssuePattern ( ) ) . andReturn ( java.util.regex.Pattern.compile ( "bug#(\\d+)" ) ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( itsConfig.isEnabled ( "myProject" , null ) ) . andReturn ( true ) . anyTimes ( ) ; }
Source:
private java.util.List < com.google.gerrit.extensions.api.projects.CommentLinkInfo > getCommitLinkInfo ( final java.lang.String commentLinkName ) { com.google.gerrit.reviewdb.client.Project.NameKey projectName = com.googlesource.gerrit.plugins.its.base.its.ItsConfig.currentProjectName.get ( ) ; if ( projectName != null ) { java.util.List < com.google.gerrit.extensions.api.projects.CommentLinkInfo > commentLinks = projectCache.get ( projectName ) . getCommentLinks ( ) ; return com.google.common.collect.FluentIterable.from ( commentLinks ) . filter ( new com.google.common.base.Predicate < com.google.gerrit.extensions.api.projects.CommentLinkInfo > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.extensions.api.projects.CommentLinkInfo input ) { return input.name.equals ( commentLinkName ) ; } } ) . toList ( ) ; } return java.util.Collections.emptyList ( ) ; }

Target:
private java.util.List < com.google.gerrit.extensions.api.projects.CommentLinkInfo > getCommitLinkInfo ( final java.lang.String commentlinkName ) { com.google.gerrit.reviewdb.client.Project.NameKey projectName = com.googlesource.gerrit.plugins.its.base.its.ItsConfig.currentProjectName.get ( ) ; if ( projectName != null ) { java.util.List < com.google.gerrit.extensions.api.projects.CommentLinkInfo > commentlinks = projectCache.get ( projectName ) . getCommentLinks ( ) ; return com.google.common.collect.FluentIterable.from ( commentlinks ) . filter ( new com.google.common.base.Predicate < com.google.gerrit.extensions.api.projects.CommentLinkInfo > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.extensions.api.projects.CommentLinkInfo input ) { return input.name.equals ( commentlinkName ) ; } } ) . toList ( ) ; } return java.util.Collections.emptyList ( ) ; }
Source:
void onRefReplicatedToOneNode ( java.lang.String project , java.lang.String ref , org.eclipse.jgit.transport.URIish uri , com.googlesource.gerrit.plugins.replication.ReplicationState.RefPushResult status , org.eclipse.jgit.transport.RemoteRefUpdate.Status refStatus ) { com.googlesource.gerrit.plugins.replication.RefReplicatedEvent event = new com.googlesource.gerrit.plugins.replication.RefReplicatedEvent ( project , ref , com.googlesource.gerrit.plugins.replication.PushResultProcessing.resolveNodeName ( uri ) , status , refStatus ) ; postEvent ( project , event ) ; }

Target:
void onRefReplicatedToAllNodes ( java.lang.String project , java.lang.String ref , int nodesCount ) { com.googlesource.gerrit.plugins.replication.RefReplicationDoneEvent event = new com.googlesource.gerrit.plugins.replication.RefReplicationDoneEvent ( project , ref , nodesCount ) ; postEvent ( project , ref , event ) ; }
Source:
public void parseStatus ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Status: NEW\n" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Status: new\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Status: OOPS\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Status: NEW\n" ) + "Status: NEW\n" ) ) ) ; }

Target:
public void parseStatus ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Patch-Set: 1\n" ) + "Status: NEW\n" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Patch-Set: 1\n" ) + "Status: new\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Status: OOPS\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Status: NEW\n" ) + "Status: NEW\n" ) ) ) ; }
Source:
private java.time.Instant now ( ) { return java.time.Instant.now ( ) ; }

Target:
public void testTokenSerializationDeserialization ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestTokenProessor processor = new com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestTokenProessor ( cipher ) ; com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken token = new com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken ( java.time.Instant.now ( ) , 0L ) ; java.lang.String serialized = processor.serialize ( token ) ; com.google.common.truth.Truth.assertThat ( serialized ) . isNotEmpty ( ) ; java.util.Optional < com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken > deserialized = processor.deserialize ( serialized ) ; com.google.common.truth.Truth.assertThat ( deserialized.isPresent ( ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( token.issued ) . isEqualTo ( deserialized.get ( ) . issued ) ; }
Source:
public void testPushForNonExistingBranch ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.ssh.PushForReviewIT.PushOneCommit push = new com.google.gerrit.acceptance.git.ssh.PushForReviewIT.PushOneCommit ( ) ; java.lang.String branchName = "non-existing" ; java.lang.String ref = "refs/for/" + branchName ; org.eclipse.jgit.transport.PushResult r = push.to ( ref ) ; com.google.gerrit.acceptance.git.ssh.PushForReviewIT.assertErrorStatus ( r , ( ( "branch " + branchName ) + " not found" ) , ref ) ; }

Target:
public void testPushForNonExistingBranch ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.PushForReviewIT.PushOneCommit push = new com.google.gerrit.acceptance.git.PushForReviewIT.PushOneCommit ( ) ; java.lang.String branchName = "non-existing" ; java.lang.String ref = "refs/for/" + branchName ; org.eclipse.jgit.transport.PushResult r = push.to ( ref ) ; com.google.gerrit.acceptance.git.PushForReviewIT.assertErrorStatus ( r , ( ( "branch " + branchName ) + " not found" ) , ref ) ; }
Source:
public com.google.gwtorm.server.ResultSet < com.google.gerrit.server.query.change.ChangeData > restart ( int start ) throws com.google.gwtorm.server.OrmException { opts = opts.withStart ( start ) ; try { source = index.getSource ( pred , opts ) ; } catch ( com.google.gerrit.server.query.QueryParseException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } return read ( ) ; }

Target:
public int getCardinality ( ) { return ( source ) != null ? source.getCardinality ( ) : opts.limit ( ) ; }
Source:
public com.google.gerrit.client.ui.InlineHyperlink getPreviousPatchLink ( int index , com.google.gerrit.client.patches.PatchScreen.Type patchType ) { if ( 0 < index ) return createLink ( ( index - 1 ) , patchType , com.google.gwtexpui.safehtml.client.SafeHtml.asis ( Util.C.prevPatchLinkIcon ( ) ) , null ) ; return null ; }

Target:
public com.google.gerrit.client.ui.InlineHyperlink getPreviousPatchLink ( int index , com.google.gerrit.client.patches.PatchScreen.Type patchType ) { for ( index -- ; index > ( - 1 ) ; index -- ) { com.google.gerrit.client.ui.InlineHyperlink link = createLink ( index , patchType , com.google.gwtexpui.safehtml.client.SafeHtml.asis ( Util.C.prevPatchLinkIcon ( ) ) , null ) ; if ( link != null ) { return link ; } } return null ; }
Source:
private com.jcraft.jsch.Session getSession ( ) throws com.jcraft.jsch.JSchException { if ( ( session ) == null ) { com.jcraft.jsch.JSch jsch = new com.jcraft.jsch.JSch ( ) ; jsch.addIdentity ( "KeyPair" , account.privateKey ( ) , account.sshKey.getPublicKeyBlob ( ) , null ) ; session = jsch.getSession ( account.username , "localhost" , 29418 ) ; session.setConfig ( "StrictHostKeyChecking" , "no" ) ; session.connect ( ) ; } return session ; }

Target:
private com.jcraft.jsch.Session getSession ( ) throws com.jcraft.jsch.JSchException { if ( ( session ) == null ) { com.jcraft.jsch.JSch jsch = new com.jcraft.jsch.JSch ( ) ; jsch.addIdentity ( "KeyPair" , account.privateKey ( ) , account.sshKey.getPublicKeyBlob ( ) , null ) ; session = jsch.getSession ( account.username , "localhost" , port ) ; session.setConfig ( "StrictHostKeyChecking" , "no" ) ; session.connect ( ) ; } return session ; }
Source:
private synchronized void unloadPlugin ( com.google.gerrit.server.plugins.Plugin plugin ) { java.lang.String name = plugin.getName ( ) ; com.google.gerrit.server.plugins.PluginLoader.log.info ( java.lang.String.format ( "Unloading plugin %s" , name ) ) ; plugin.stop ( env ) ; running.remove ( name ) ; disabled.remove ( name ) ; toCleanup.add ( plugin ) ; }

Target:
private synchronized void unloadPlugin ( com.google.gerrit.server.plugins.Plugin plugin ) { persistentCacheFactory.onStop ( plugin ) ; java.lang.String name = plugin.getName ( ) ; com.google.gerrit.server.plugins.PluginLoader.log.info ( java.lang.String.format ( "Unloading plugin %s" , name ) ) ; plugin.stop ( env ) ; running.remove ( name ) ; disabled.remove ( name ) ; toCleanup.add ( plugin ) ; }
Source:
private com.atlassian.jira.rest.client.api.domain.Transition getTransitionByName ( java.lang.Iterable < com.atlassian.jira.rest.client.api.domain.Transition > transitions , java.lang.String transition ) { com.atlassian.jira.rest.client.api.domain.Transition ret = null ; for ( com.atlassian.jira.rest.client.api.domain.Transition t : transitions ) { if ( transition.equals ( t.getName ( ) ) ) { ret = t ; break ; } } return ret ; }

Target:
private JiraTransition.Item getTransitionByName ( java.lang.String issueKey , java.lang.String transition ) throws java.io.IOException { for ( com.googlesource.gerrit.plugins.its.jira.restapi.JiraTransition.Item t : getTransitions ( issueKey ) ) { if ( transition.equals ( t.getName ( ) ) ) { return t ; } } return null ; }
Source:
public static java.lang.String stripGitSuffix ( java.lang.String name ) { java.lang.String nameWithoutSuffix = name ; if ( nameWithoutSuffix.endsWith ( Constants.DOT_GIT_EXT ) ) { nameWithoutSuffix = nameWithoutSuffix.substring ( 0 , ( ( nameWithoutSuffix.length ( ) ) - ( Constants.DOT_GIT_EXT.length ( ) ) ) ) ; while ( nameWithoutSuffix.endsWith ( "/" ) ) { nameWithoutSuffix = nameWithoutSuffix.substring ( 0 , ( ( nameWithoutSuffix.length ( ) ) - 1 ) ) ; } } return nameWithoutSuffix ; }

Target:
public static java.lang.String stripGitSuffix ( java.lang.String name ) { if ( name.endsWith ( ".git" ) ) { name = name.substring ( 0 , ( ( name.length ( ) ) - 4 ) ) ; while ( name.endsWith ( "/" ) ) { name = name.substring ( 0 , ( ( name.length ( ) ) - 1 ) ) ; } } return name ; }
Source:
public void onSuccess ( com.google.gwt.core.client.JsArrayString result ) { hashtagTextBox.setEnabled ( true ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( error , false ) ; error.setInnerText ( "" ) ; hashtagTextBox.setText ( "" ) ; if ( ( result != null ) && ( ( result.length ( ) ) > 0 ) ) { updateHashtagList ( result ) ; } }

Target:
public void onSuccess ( com.google.gwt.core.client.JsArrayString result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( psId.getParentKey ( ) , java.lang.String.valueOf ( psId.get ( ) ) ) ) ; }
Source:
public void parseAuthor ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( "\n" + "Patch-Set: 1\n" ) ) ) ; assertParseFails ( writeCommit ( ( "Update change\n" + ( "\n" + "Patch-Set: 1\n" ) ) , new org.eclipse.jgit.lib.PersonIdent ( "Change Owner" , "owner@example.com" , serverIdent.getWhen ( ) , serverIdent.getTimeZone ( ) ) ) ) ; assertParseFails ( writeCommit ( ( "Update change\n" + ( "\n" + "Patch-Set: 1\n" ) ) , new org.eclipse.jgit.lib.PersonIdent ( "Change Owner" , "x@gerrit" , serverIdent.getWhen ( ) , serverIdent.getTimeZone ( ) ) ) ) ; }

Target:
public void parseAuthor ( ) 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" ) ) ) ; assertParseFails ( writeCommit ( ( "Update change\n" + ( "\n" + "Patch-Set: 1\n" ) ) , new org.eclipse.jgit.lib.PersonIdent ( "Change Owner" , "owner@example.com" , serverIdent.getWhen ( ) , serverIdent.getTimeZone ( ) ) ) ) ; assertParseFails ( writeCommit ( ( "Update change\n" + ( "\n" + "Patch-Set: 1\n" ) ) , new org.eclipse.jgit.lib.PersonIdent ( "Change Owner" , "x@gerrit" , serverIdent.getWhen ( ) , serverIdent.getTimeZone ( ) ) ) ) ; }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { final boolean prior = starred ; setStarred ( ( ! prior ) ) ; final com.google.gerrit.client.changes.ToggleStarRequest req = new com.google.gerrit.client.changes.ToggleStarRequest ( ) ; req.toggle ( changeId , starred ) ; Util.LIST_SVC.toggleStars ( req , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { super . onFailure ( caught ) ; setStarred ( prior ) ; } } ) ; }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { toggleStar ( ) ; }
Source:
protected void doPost ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) { this . healthy = true ; rsp.setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; }

Target:
protected void 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 ; } try { setHealthy ( ) ; rsp.setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.health.HealthServlet.log.error ( "Failed to set healthy" , e ) ; sendError ( rsp , javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR ) ; } }
Source:
public com.google.gerrit.server.group.GroupJson.GroupInfo apply ( com.google.gerrit.server.group.GroupResource resource ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.AccountGroup group = resource.toAccountGroup ( ) ; if ( group == null ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } try { com.google.gerrit.server.account.GroupControl c = controlFactory.validateFor ( group.getOwnerGroupUUID ( ) ) ; return json.format ( c.getGroup ( ) ) ; } catch ( com.google.gerrit.common.errors.NoSuchGroupException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } }

Target:
public com.google.gerrit.server.group.GroupJson.GroupInfo apply ( com.google.gerrit.server.group.GroupResource resource ) throws com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.AccountGroup group = resource.toAccountGroup ( ) ; if ( group == null ) { throw new com.google.gerrit.extensions.restapi.MethodNotAllowedException ( ) ; } try { com.google.gerrit.server.account.GroupControl c = controlFactory.validateFor ( group.getOwnerGroupUUID ( ) ) ; return json.format ( c.getGroup ( ) ) ; } catch ( com.google.gerrit.common.errors.NoSuchGroupException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } }
Source:
private void setupDeleteMocks ( boolean exception ) throws java.io.IOException { indexer.delete ( id ) ; if ( exception ) { org.easymock.EasyMock.expectLastCall ( ) . andThrow ( new java.io.IOException ( ) ) ; } else { org.easymock.EasyMock.expectLastCall ( ) . once ( ) ; } replayAll ( ) ; }

Target:
public void indexerThrowsExceptionTryingToDeleteChange ( ) throws java.lang.Exception { org.mockito.Mockito.doThrow ( new java.io.IOException ( "io-error" ) ) . when ( indexer ) . delete ( id ) ; syncIndexRestApiServlet.doDelete ( req , rsp ) ; org.mockito.Mockito.verify ( rsp ) . sendError ( javax.servlet.http.HttpServletResponse.SC_CONFLICT , "io-error" ) ; }
Source:
private org.eclipse.jgit.revwalk.RevCommit makeCommit ( ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException , org.eclipse.jgit.api.errors.NoFilepatternException { java.util.Set < java.io.File > files = new java.util.HashSet < > ( ) ; for ( java.lang.String filenames : getInvalidFilenames ( ) ) { files.add ( new java.io.File ( repo.getDirectory ( ) . getParent ( ) , filenames ) ) ; } files.add ( new java.io.File ( repo.getDirectory ( ) . getParent ( ) , "test" ) ) ; return com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.makeCommit ( repo , "Commit with empty test files." , files ) ; }

Target:
private org.eclipse.jgit.revwalk.RevCommit makeCommit ( ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.util.Set < java.io.File > files = new java.util.HashSet < > ( ) ; for ( java.lang.String filenames : com.googlesource.gerrit.plugins.uploadvalidator.InvalidFilenameValidatorTest.getInvalidFilenames ( ) ) { files.add ( new java.io.File ( repo.getDirectory ( ) . getParent ( ) , filenames ) ) ; } files.add ( new java.io.File ( repo.getDirectory ( ) . getParent ( ) , "test" ) ) ; return com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.makeCommit ( repo , "Commit with empty test files." , files ) ; }
Source:
public void testPreformat2 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.html ( "A\n\n This is pre\n formatted\n\nbut this is not" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; org.junit.Assert.assertNotSame ( o , n ) ; org.junit.Assert.assertEquals ( ( ( ( ( ( "<p>A</p>" + "<p>" ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " This is pre" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " formatted" ) ) ) + "</p>" ) + "<p>but this is not</p>" ) , n.asString ( ) ) ; }

Target:
public void testPreformat2 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.html ( "A\n\n This is pre\n formatted\n\nbut this is not" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; com.google.common.truth.Truth.assertThat ( o ) . isNotSameAs ( n ) ; com.google.common.truth.Truth.assertThat ( n.asString ( ) ) . isEqualTo ( ( ( ( ( ( "<p>A</p>" + "<p>" ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " This is pre" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " formatted" ) ) ) + "</p>" ) + "<p>but this is not</p>" ) ) ; }
Source:
public com.google.gerrit.reviewdb.PatchSetInfo get ( org.eclipse.jgit.revwalk.RevCommit src , com.google.gerrit.reviewdb.PatchSet.Id psi ) { com.google.gerrit.reviewdb.PatchSetInfo info = new com.google.gerrit.reviewdb.PatchSetInfo ( psi ) ; info.setSubject ( src.getShortMessage ( ) ) ; info.setMessage ( src.getFullMessage ( ) ) ; info.setAuthor ( toUserIdentity ( src.getAuthorIdent ( ) ) ) ; info.setCommitter ( toUserIdentity ( src.getCommitterIdent ( ) ) ) ; return info ; }

Target:
public com.google.gerrit.reviewdb.PatchSetInfo get ( org.eclipse.jgit.revwalk.RevCommit src , com.google.gerrit.reviewdb.PatchSet.Id psi ) { com.google.gerrit.reviewdb.PatchSetInfo info = new com.google.gerrit.reviewdb.PatchSetInfo ( psi ) ; info.setSubject ( src.getShortMessage ( ) ) ; info.setMessage ( src.getFullMessage ( ) ) ; info.setAuthor ( toUserIdentity ( src.getAuthorIdent ( ) ) ) ; info.setCommitter ( toUserIdentity ( src.getCommitterIdent ( ) ) ) ; info.setRevId ( src.getName ( ) ) ; return info ; }
Source:
protected void createProject ( java.lang.String name , com.google.gerrit.reviewdb.client.Project.NameKey parent , boolean createEmptyCommit ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.name = name ; in.parent = ( parent != null ) ? parent.get ( ) : null ; in.createEmptyCommit = createEmptyCommit ; createProject ( in ) ; }

Target:
protected java.lang.String name ( java.lang.String name ) { return ( resourcePrefix ) + name ; }
Source:
public void delete ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { try { deleteTask ( cd ) . call ( ) ; } catch ( java.lang.RuntimeException e ) { throw e ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.index.ChangeIndexer.MAPPER.apply ( e ) ; } }

Target:
public void index ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { try { new com.google.gerrit.server.index.ChangeIndexer.Task ( cd , false ) . call ( ) ; } catch ( java.lang.RuntimeException e ) { throw e ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.index.ChangeIndexer.MAPPER.apply ( e ) ; } }
Source:
public void commentOnReviewableWipChangeByBot ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; com.google.gerrit.acceptance.TestAccount bot = sc.testAccount ( "bot" ) ; review ( bot , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED , null , "tag" ) ; assertThat ( sender ) . sent ( "comment" , sc ) . to ( sc.owner ) . notTo ( sc.reviewer , sc.ccer ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( sc.starrer ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void commentOnReviewableWipChangeByBotNotifyAll ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; com.google.gerrit.acceptance.TestAccount bot = sc.testAccount ( "bot" ) ; review ( bot , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED , com.google.gerrit.extensions.api.changes.NotifyHandling.ALL , "tag" ) ; assertThat ( sender ) . sent ( "comment" , sc ) . to ( sc.owner ) . cc ( 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 void setCommit ( org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.lib.ObjectId id ) throws java.io.IOException { org.eclipse.jgit.revwalk.RevCommit commit = rw.parseCommit ( id ) ; rw.parseBody ( commit ) ; this . commit = commit ; subject = commit.getShortMessage ( ) ; }

Target:
public void setCommit ( org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.lib.ObjectId id , java.lang.String pushCert ) throws java.io.IOException { org.eclipse.jgit.revwalk.RevCommit commit = rw.parseCommit ( id ) ; rw.parseBody ( commit ) ; this . commit = commit ; subject = commit.getShortMessage ( ) ; this . pushCert = pushCert ; }
Source:
public void patchSetObjectMissing ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( c.currentPatchSetId ( ) , org.eclipse.jgit.lib.ObjectId.fromString ( "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) , userId ) ; db.patchSets ( ) . insert ( java.util.Collections.singleton ( ps ) ) ; assertProblems ( c , "Object missing: patch set 1: deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ; }

Target:
public void patchSetObjectAndRefMissing ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( c.currentPatchSetId ( ) , org.eclipse.jgit.lib.ObjectId.fromString ( "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) , userId ) ; db.patchSets ( ) . insert ( java.util.Collections.singleton ( ps ) ) ; assertProblems ( c , ( "Ref missing: " + ( ps.getId ( ) . toRefName ( ) ) ) , "Object missing: patch set 1: deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ; }
Source:
private com.google.gwtorm.client.OrmException convertError ( final java.lang.String op , final java.sql.SQLException err ) { if ( ( ( err.getCause ( ) ) == null ) && ( ( err.getNextException ( ) ) != null ) ) { err.initCause ( err.getNextException ( ) ) ; } return schema.getDialect ( ) . convertError ( op , getRelationName ( ) , err ) ; }

Target:
public void delete ( final java.lang.Iterable < T > instances ) throws com.google.gwtorm.server.OrmException { try { if ( schema.getDialect ( ) . canDetermineIndividualBatchUpdateCounts ( ) ) { deleteAsBatch ( instances ) ; } else { deleteIndividually ( instances ) ; } } catch ( java.sql.SQLException e ) { throw convertError ( "delete" , e ) ; } }
Source:
public java.util.List < com.google.gerrit.extensions.api.projects.BranchInfo > apply ( com.google.gerrit.server.project.ProjectResource rsrc ) throws com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { return new com.google.gerrit.server.project.RefFilter < com.google.gerrit.extensions.api.projects.BranchInfo > ( org.eclipse.jgit.lib.Constants.R_HEADS ) . subString ( matchSubstring ) . regex ( matchRegex ) . start ( start ) . limit ( limit ) . filter ( allBranches ( rsrc ) ) ; }

Target:
public java.util.List < com.google.gerrit.extensions.api.projects.BranchInfo > apply ( com.google.gerrit.server.project.ProjectResource rsrc ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { rsrc.getProjectState ( ) . checkStatePermitsRead ( ) ; return new com.google.gerrit.server.project.RefFilter < com.google.gerrit.extensions.api.projects.BranchInfo > ( org.eclipse.jgit.lib.Constants.R_HEADS ) . subString ( matchSubstring ) . regex ( matchRegex ) . start ( start ) . limit ( limit ) . filter ( allBranches ( rsrc ) ) ; }
Source:
public com.google.gerrit.server.events.MessageAttribute asMessageAttribute ( com.google.gerrit.reviewdb.ChangeMessage message ) { com.google.gerrit.server.events.MessageAttribute a = new com.google.gerrit.server.events.MessageAttribute ( ) ; a.timestamp = ( message.getWrittenOn ( ) . getTime ( ) ) / 1000L ; a.reviewer = asAccountAttribute ( message.getAuthor ( ) ) ; a.message = message.getMessage ( ) ; return a ; }

Target:
public com.google.gerrit.server.events.MessageAttribute asMessageAttribute ( com.google.gerrit.reviewdb.client.ChangeMessage message ) { com.google.gerrit.server.events.MessageAttribute a = new com.google.gerrit.server.events.MessageAttribute ( ) ; a.timestamp = ( message.getWrittenOn ( ) . getTime ( ) ) / 1000L ; a.reviewer = asAccountAttribute ( message.getAuthor ( ) ) ; a.message = message.getMessage ( ) ; return a ; }
Source:
public com.google.gerrit.server.plugins.ServerPlugin get ( java.io.File srcFile , org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot , com.googlesource.gerrit.plugins.cookbook.pluginprovider.PluginDescription pluginDescriptor ) throws com.google.gerrit.server.plugins.InvalidPluginException { java.lang.String name = getPluginName ( srcFile ) ; return new com.google.gerrit.server.plugins.ServerPlugin ( name , pluginDescriptor.canonicalUrl , pluginDescriptor.user , srcFile , snapshot , new com.googlesource.gerrit.plugins.cookbook.pluginprovider.HelloSshPluginContentScanner ( name ) , pluginDescriptor.dataDir , getClass ( ) . getClassLoader ( ) ) ; }

Target:
public com.google.gerrit.server.plugins.ServerPlugin get ( java.nio.file.Path srcPath , org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot , com.googlesource.gerrit.plugins.cookbook.pluginprovider.PluginDescription pluginDescriptor ) throws com.google.gerrit.server.plugins.InvalidPluginException { java.lang.String name = getPluginName ( srcPath ) ; return new com.google.gerrit.server.plugins.ServerPlugin ( name , pluginDescriptor.canonicalUrl , pluginDescriptor.user , srcPath , snapshot , new com.googlesource.gerrit.plugins.cookbook.pluginprovider.HelloSshPluginContentScanner ( name ) , pluginDescriptor.dataDir , getClass ( ) . getClassLoader ( ) ) ; }
Source:
com.google.gerrit.server.git.strategy.SubmitStrategy.Arguments create ( com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.server.git.MergeOp.CommitStatus commits , com.google.gerrit.server.git.CodeReviewCommit.CodeReviewRevWalk rw , com.google.gerrit.server.IdentifiedUser caller , com.google.gerrit.server.git.MergeTip mergeTip , org.eclipse.jgit.lib.ObjectInserter inserter , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevFlag canMergeFlag , com.google.gerrit.reviewdb.server.ReviewDb db , java.util.Set < org.eclipse.jgit.revwalk.RevCommit > alreadyAccepted , com.google.gerrit.server.util.RequestId submissionId , com.google.gerrit.extensions.api.changes.NotifyHandling notifyHandling , com.google.gerrit.server.git.SubmoduleOp submoduleOp , boolean dryrun ) ;

Target:
com.google.gerrit.server.git.strategy.SubmitStrategy.Arguments create ( com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.server.git.MergeOp.CommitStatus commits , com.google.gerrit.server.git.CodeReviewCommit.CodeReviewRevWalk rw , com.google.gerrit.server.IdentifiedUser caller , com.google.gerrit.server.git.MergeTip mergeTip , org.eclipse.jgit.lib.ObjectInserter inserter , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevFlag canMergeFlag , com.google.gerrit.reviewdb.server.ReviewDb db , java.util.Set < org.eclipse.jgit.revwalk.RevCommit > alreadyAccepted , com.google.gerrit.server.util.RequestId submissionId , com.google.gerrit.extensions.api.changes.NotifyHandling notifyHandling , com.google.common.collect.Multimap < com.google.gerrit.extensions.api.changes.RecipientType , com.google.gerrit.reviewdb.client.Account.Id > accountsToNotify , com.google.gerrit.server.git.SubmoduleOp submoduleOp , boolean dryrun ) ;
Source:
void onDiscard ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; if ( isNew ( ) ) { removeUI ( ) ; } else { setEdit ( false ) ; com.google.gerrit.client.changes.CommentApi.deleteDraft ( psId , comment.id ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwt.core.client.JavaScriptObject > ( ) { @ java.lang.Override public void onSuccess ( com.google.gwt.core.client.JavaScriptObject result ) { removeUI ( ) ; } } ) ; } }

Target:
void onCancel ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; if ( ( isNew ( ) ) && ( ! ( isDirty ( ) ) ) ) { removeUI ( ) ; restoreSelection ( ) ; } else { setEdit ( false ) ; if ( autoClosed ) { setOpen ( false ) ; } getCm ( ) . focus ( ) ; } }
Source:
public static void patch ( java.lang.String token , final com.google.gerrit.reviewdb.Patch.Key id , final int patchIndex , final com.google.gerrit.common.data.PatchSetDetail patchSetDetail , final com.google.gerrit.client.changes.PatchTable patchTable , final java.lang.String panelType ) { com.google.gerrit.client.Dispatcher.patch ( token , id , patchIndex , patchSetDetail , patchTable , null , panelType ) ; }

Target:
public static void patch ( java.lang.String token , com.google.gerrit.reviewdb.PatchSet.Id base , com.google.gerrit.reviewdb.Patch.Key id , int patchIndex , com.google.gerrit.common.data.PatchSetDetail patchSetDetail , com.google.gerrit.client.changes.PatchTable patchTable , java.lang.String panelType ) { com.google.gerrit.client.Dispatcher.patch ( token , base , id , patchIndex , patchSetDetail , patchTable , null , panelType ) ; }
Source:
public synchronized com.google.gerrit.server.index.change.ChangeIndex addWriteIndex ( com.google.gerrit.server.index.change.ChangeIndex index ) { int version = index.getSchema ( ) . getVersion ( ) ; for ( int i = 0 ; i < ( writeIndexes.size ( ) ) ; i ++ ) { if ( ( writeIndexes.get ( i ) . getSchema ( ) . getVersion ( ) ) == version ) { return writeIndexes.set ( i , index ) ; } } writeIndexes.add ( index ) ; return null ; }

Target:
public synchronized I addWriteIndex ( I index ) { int version = index.getSchema ( ) . getVersion ( ) ; for ( int i = 0 ; i < ( writeIndexes.size ( ) ) ; i ++ ) { if ( ( writeIndexes.get ( i ) . getSchema ( ) . getVersion ( ) ) == version ) { return writeIndexes.set ( i , index ) ; } } writeIndexes.add ( index ) ; return null ; }
Source:
public Account.Id createEntry ( final java.lang.String username ) throws java.lang.Exception { try { final com.google.gerrit.reviewdb.ReviewDb db = schema.open ( ) ; try { final com.google.gerrit.reviewdb.AccountExternalId extId = db.accountExternalIds ( ) . get ( new com.google.gerrit.reviewdb.AccountExternalId.Key ( com.google.gerrit.reviewdb.AccountExternalId.SCHEME_GERRIT , username ) ) ; return extId != null ? extId.getAccountId ( ) : null ; } finally { db.close ( ) ; } } catch ( com.google.gwtorm.client.OrmException e ) { com.google.gerrit.server.auth.ldap.LdapRealm.log.warn ( "Cannot query for username in database" , e ) ; return null ; } }

Target:
public Account.Id createEntry ( final java.lang.String username ) throws java.lang.Exception { try { final com.google.gerrit.reviewdb.ReviewDb db = schema.open ( ) ; try { final com.google.gerrit.reviewdb.AccountExternalId extId = accountExternalIdCache.get ( new com.google.gerrit.reviewdb.AccountExternalId.Key ( com.google.gerrit.reviewdb.AccountExternalId.SCHEME_GERRIT , username ) ) ; return extId != null ? extId.getAccountId ( ) : null ; } finally { db.close ( ) ; } } catch ( com.google.gwtorm.client.OrmException e ) { com.google.gerrit.server.auth.ldap.LdapRealm.log.warn ( "Cannot query for username in database" , e ) ; return null ; } }
Source:
public void registerKeys ( ) { super . registerKeys ( ) ; keys.add ( com.google.gwtexpui.globalkey.client.GlobalKey.add ( this , keysNavigation ) ) ; keys.add ( com.google.gwtexpui.globalkey.client.GlobalKey.add ( this , keysAction ) ) ; files.registerKeys ( ) ; }

Target:
public void registerKeys ( ) { super . registerKeys ( ) ; keys.add ( com.google.gwtexpui.globalkey.client.GlobalKey.add ( this , keysNavigation ) ) ; keys.add ( com.google.gwtexpui.globalkey.client.GlobalKey.add ( this , keysAction ) ) ; files.registerKeys ( ) ; related.registerKeys ( ) ; }
Source:
protected void configureServlets ( ) { install ( new com.google.gerrit.server.config.FactoryModule ( ) { @ java.lang.Override protected void configure ( ) { factory ( ChangeDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; } } ) ; rpc ( com.google.gerrit.server.rpc.changedetail.ChangeDetailServiceImpl.class ) ; }

Target:
protected void configureServlets ( ) { install ( new com.google.gerrit.server.config.FactoryModule ( ) { @ java.lang.Override protected void configure ( ) { factory ( ChangeDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( SubmitAction.Factory.class ) ; } } ) ; rpc ( com.google.gerrit.server.rpc.changedetail.ChangeDetailServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.changedetail.ChangeManageServiceImpl.class ) ; }
Source:
private static void deleteRemoteSsh ( org.eclipse.jgit.transport.URIish uri ) { java.lang.String quotedPath = QuotedString.BOURNE.quote ( uri.getPath ( ) ) ; java.lang.String cmd = "rm -rf " + quotedPath ; java.io.OutputStream errStream = com.googlesource.gerrit.plugins.replication.ReplicationQueue.newErrorBufferStream ( ) ; try { com.googlesource.gerrit.plugins.replication.ReplicationQueue.executeRemotSsh ( uri , cmd , errStream ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.log.error ( java.lang.String.format ( ( "Error deleting remote repository at %s:\n" + ( ( " Exception: %s\n" + " Command: %s\n" ) + " Output: %s" ) ) , uri , e , cmd , errStream ) , e ) ; } }

Target:
private static void deleteRemoteSsh ( org.eclipse.jgit.transport.URIish uri ) { java.lang.String quotedPath = QuotedString.BOURNE.quote ( uri.getPath ( ) ) ; java.lang.String cmd = "rm -rf " + quotedPath ; java.io.OutputStream errStream = com.googlesource.gerrit.plugins.replication.ReplicationQueue.newErrorBufferStream ( ) ; try { com.googlesource.gerrit.plugins.replication.ReplicationQueue.executeRemoteSsh ( uri , cmd , errStream ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.log.error ( java.lang.String.format ( ( "Error deleting remote repository at %s:\n" + ( ( " Exception: %s\n" + " Command: %s\n" ) + " Output: %s" ) ) , uri , e , cmd , errStream ) , e ) ; } }
Source:
private void assertCanEdit ( com.google.gerrit.server.project.ChangeControl changeControl ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException { if ( ! ( currentUser.get ( ) . isIdentifiedUser ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } try { permissionBackend.user ( currentUser ) . database ( reviewDb ) . change ( changeControl.getNotes ( ) ) . check ( ChangePermission.ADD_PATCH_SET ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException denied ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "edit not permitted" , denied ) ; } }

Target:
private void assertCanEdit ( com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException { if ( ! ( currentUser.get ( ) . isIdentifiedUser ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } try { permissionBackend.user ( currentUser ) . database ( reviewDb ) . change ( notes ) . check ( ChangePermission.ADD_PATCH_SET ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException denied ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "edit not permitted" , denied ) ; } }
Source:
private static boolean eq ( final org.eclipse.jgit.lib.ObjectId a , final org.eclipse.jgit.lib.ObjectId b ) { if ( ( a == null ) && ( b == null ) ) { return true ; } return ( ( a != null ) && ( b != null ) ) && ( org.eclipse.jgit.lib.AnyObjectId.equals ( a , b ) ) ; }

Target:
public static com.google.gerrit.server.patch.PatchListKey againstParentNum ( int parentNum , org.eclipse.jgit.lib.AnyObjectId newId , com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace ws ) { return new com.google.gerrit.server.patch.PatchListKey ( parentNum , newId , ws ) ; }
Source:
public void pushNewPatchsetToRefsChanges ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = pushTo ( "refs/for/master" ) ; r.assertOkStatus ( ) ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo , PushOneCommit.SUBJECT , "b.txt" , "anotherContent" , r.getChangeId ( ) ) ; r = push.to ( ( "refs/changes/" + ( r.getChange ( ) . change ( ) . getId ( ) . get ( ) ) ) ) ; r.assertOkStatus ( ) ; }

Target:
public void testPushNewPatchsetToRefsChanges ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = pushTo ( "refs/for/master" ) ; r.assertOkStatus ( ) ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo , PushOneCommit.SUBJECT , "b.txt" , "anotherContent" , r.getChangeId ( ) ) ; r = push.to ( ( "refs/changes/" + ( r.getChange ( ) . change ( ) . getId ( ) . get ( ) ) ) ) ; r.assertOkStatus ( ) ; }
Source:
private com.google.gerrit.reviewdb.client.Account findAccount ( java.lang.String nameOrEmail ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Account r = accountResolver.find ( nameOrEmail ) ; if ( r == null ) { switch ( authType ) { case HTTP_LDAP : case CLIENT_SSL_CERT_LDAP : case LDAP : r = createAccountByLdap ( nameOrEmail ) ; break ; default : } } return r ; }

Target:
private com.google.gerrit.reviewdb.client.Account findAccount ( java.lang.String nameOrEmail ) throws com.google.gwtorm.server.OrmException { try { return accounts.get ( ) . parse ( nameOrEmail ) . getAccount ( ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException e ) { return null ; } catch ( com.google.gerrit.extensions.restapi.ResourceNotFoundException e ) { switch ( authType ) { case HTTP_LDAP : case CLIENT_SSL_CERT_LDAP : case LDAP : if ( ( accountResolver.find ( nameOrEmail ) ) == null ) { return createAccountByLdap ( nameOrEmail ) ; } break ; default : } return null ; } }
Source:
private static void assertParseNotifyValue ( java.lang.String notifyValue , java.lang.String expectedFilter , java.util.Set < com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType > expectedNotifyTypes ) throws org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.account.WatchConfig.NotifyValue nv = com.google.gerrit.server.account.WatchConfigTest.parseNotifyValue ( notifyValue ) ; com.google.common.truth.Truth.assertThat ( nv.filter ( ) ) . isEqualTo ( expectedFilter ) ; com.google.common.truth.Truth.assertThat ( nv.notifyTypes ( ) ) . containsExactlyElementsIn ( expectedNotifyTypes ) ; }

Target:
private void assertParseNotifyValue ( java.lang.String notifyValue , java.lang.String expectedFilter , java.util.Set < com.google.gerrit.server.account.WatchConfig.NotifyType > expectedNotifyTypes ) { com.google.gerrit.server.account.WatchConfig.NotifyValue nv = parseNotifyValue ( notifyValue ) ; com.google.common.truth.Truth.assertThat ( nv.filter ( ) ) . isEqualTo ( expectedFilter ) ; com.google.common.truth.Truth.assertThat ( nv.notifyTypes ( ) ) . containsExactlyElementsIn ( expectedNotifyTypes ) ; }
Source:
private < T > T execute ( com.google.gerrit.server.update.RetryHelper.Action < T > action , com.google.gerrit.server.update.RetryHelper.Options opts , com.google.common.base.Predicate < java.lang.Throwable > exceptionPredicate ) throws java.lang.Throwable { com.google.gerrit.server.update.RetryHelper.MetricListener listener = new com.google.gerrit.server.update.RetryHelper.MetricListener ( ) ; try { com.github.rholder.retry.RetryerBuilder < T > retryerBuilder = createRetryerBuilder ( opts , exceptionPredicate ) ; retryerBuilder.withRetryListener ( listener ) ; return execute ( action , retryerBuilder.build ( ) ) ; } finally { metrics.attemptCounts.record ( listener.getAttemptCount ( ) ) ; } }

Target:
private < T > T execute ( com.google.gerrit.server.update.RetryHelper.ActionType actionType , com.google.gerrit.server.update.RetryHelper.Action < T > action , com.google.gerrit.server.update.RetryHelper.Options opts , com.google.common.base.Predicate < java.lang.Throwable > exceptionPredicate ) throws java.lang.Throwable { com.google.gerrit.server.update.RetryHelper.MetricListener listener = new com.google.gerrit.server.update.RetryHelper.MetricListener ( ) ; try { com.github.rholder.retry.RetryerBuilder < T > retryerBuilder = createRetryerBuilder ( opts , exceptionPredicate ) ; retryerBuilder.withRetryListener ( listener ) ; return execute ( actionType , action , retryerBuilder.build ( ) ) ; } finally { metrics.attemptCounts.record ( actionType , listener.getAttemptCount ( ) ) ; } }
Source:
public void testBlockRule_ParentBlocksChildEvenIfAlreadyBlockedInChild ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/tags/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) . setBlock ( ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't update tag" , u.controlForRef ( "refs/tags/V10" ) . canUpdate ( ) ) ; }

Target:
public void testBlockRule_ParentBlocksChildEvenIfAlreadyBlockedInChild ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/tags/*" ) ; com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) ; com.google.gerrit.server.project.Util.block ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't update tag" , u.controlForRef ( "refs/tags/V10" ) . canUpdate ( ) ) ; }