auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void byProject ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo1 = createProject ( "repo1" ) ; org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo2 = createProject ( "repo2" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( newChange ( repo1 ) ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( newChange ( repo2 ) ) ; assertQuery ( "project:foo" ) ; assertQuery ( "project:repo" ) ; assertQuery ( "project:repo1" , change1 ) ; assertQuery ( "project:repo2" , change2 ) ; }

Target:
public void byProject ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo1 = createProject ( "repo1" ) ; org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo2 = createProject ( "repo2" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( repo1 , newChange ( repo1 ) ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( repo2 , newChange ( repo2 ) ) ; assertQuery ( "project:foo" ) ; assertQuery ( "project:repo" ) ; assertQuery ( "project:repo1" , change1 ) ; assertQuery ( "project:repo2" , change2 ) ; }
Source:
public static com.google.gwtorm.schema.sql.SqlDialect getDialectFor ( java.sql.Connection c ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { java.lang.String url = c.getMetaData ( ) . getURL ( ) ; for ( com.google.gwtorm.schema.sql.SqlDialect d : com.google.gwtorm.schema.sql.SqlDialect.DIALECTS ) { if ( d.handles ( url , c ) ) { return d.refine ( c ) ; } } throw new com.google.gwtorm.client.OrmException ( ( "No dialect known for " + url ) ) ; }

Target:
public static com.google.gwtorm.schema.sql.SqlDialect getDialectFor ( java.sql.Connection c ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.lang.String url = c.getMetaData ( ) . getURL ( ) ; for ( com.google.gwtorm.schema.sql.SqlDialect d : com.google.gwtorm.schema.sql.SqlDialect.DIALECTS ) { if ( d.handles ( url , c ) ) { return d.refine ( c ) ; } } throw new com.google.gwtorm.server.OrmException ( ( "No dialect known for " + url ) ) ; }
Source:
public java.lang.String formatWithEquals ( ) { if ( ( value ( ) ) <= ( ( short ) ( 0 ) ) ) { return ( ( label ( ) ) + '=' ) + ( value ( ) ) ; } else { return ( ( label ( ) ) + "=+" ) + ( value ( ) ) ; } }

Target:
public java.lang.String formatWithEquals ( ) { if ( ( value ( ) ) <= ( ( short ) ( 0 ) ) ) { return ( ( label ( ) ) + '=' ) + ( value ( ) ) ; } return ( ( label ( ) ) + "=+" ) + ( value ( ) ) ; }
Source:
public com.google.common.util.concurrent.ListenableFuture < ? > rebuildAsync ( final com.google.gerrit.reviewdb.client.Change change , com.google.common.util.concurrent.ListeningExecutorService executor , final org.eclipse.jgit.lib.BatchRefUpdate bru , final org.eclipse.jgit.lib.BatchRefUpdate bruForDrafts , final org.eclipse.jgit.lib.Repository changeRepo , final org.eclipse.jgit.lib.Repository allUsersRepo ) { return executor.submit ( new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) throws java.lang.Exception { rebuild ( change , bru , bruForDrafts , changeRepo , allUsersRepo ) ; return null ; } } ) ; }

Target:
public com.google.common.util.concurrent.ListenableFuture < ? > rebuildAsync ( final com.google.gerrit.reviewdb.client.Change change , com.google.common.util.concurrent.ListeningExecutorService executor , final org.eclipse.jgit.lib.Repository changeRepo ) { return executor.submit ( new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) throws java.lang.Exception { rebuild ( change , changeRepo ) ; 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.reviewdb.client.AccountProjectWatch.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:
public void createAnnotatedTagNotAllowed ( ) throws java.lang.Exception { block ( Permission.CREATE_TAG , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , ( ( org.eclipse.jgit.lib.Constants.R_TAGS ) + "*" ) ) ; com.google.gerrit.extensions.api.projects.TagInput input = new com.google.gerrit.extensions.api.projects.TagInput ( ) ; input.ref = "test" ; input.message = "annotation" ; exception.expect ( com.google.gerrit.extensions.restapi.AuthException.class ) ; exception.expectMessage ( ( ( "Cannot create annotated tag \"" + ( org.eclipse.jgit.lib.Constants.R_TAGS ) ) + "test\"" ) ) ; tag ( input.ref ) . create ( input ) ; }

Target:
public void createAnnotatedTagNotAllowed ( ) throws java.lang.Exception { block ( ( ( org.eclipse.jgit.lib.Constants.R_TAGS ) + "*" ) , Permission.CREATE_TAG , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; com.google.gerrit.extensions.api.projects.TagInput input = new com.google.gerrit.extensions.api.projects.TagInput ( ) ; input.ref = "test" ; input.message = "annotation" ; exception.expect ( com.google.gerrit.extensions.restapi.AuthException.class ) ; exception.expectMessage ( ( ( "Cannot create annotated tag \"" + ( org.eclipse.jgit.lib.Constants.R_TAGS ) ) + "test\"" ) ) ; tag ( input.ref ) . create ( input ) ; }
Source:
public com.google.gerrit.extensions.api.changes.ChangeApi revert ( com.google.gerrit.extensions.api.changes.RevertInput in ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return changeApi.id ( revert.get ( ) . apply ( change , in ) . _number ) ; } catch ( com.google.gwtorm.server.OrmException | com.google.gerrit.common.errors.EmailException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot revert change" , e ) ; } }

Target:
public com.google.gerrit.extensions.api.changes.ChangeApi revert ( com.google.gerrit.extensions.api.changes.RevertInput in ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return changeApi.id ( revert.apply ( change , in ) . _number ) ; } catch ( com.google.gwtorm.server.OrmException | com.google.gerrit.common.errors.EmailException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot revert change" , e ) ; } }
Source:
protected void init ( ) throws com.google.gerrit.common.errors.EmailException { super . init ( ) ; setListIdHeader ( ) ; add ( RecipientType.TO , to ) ; if ( ! ( threadId.isEmpty ( ) ) ) { setHeader ( MailHeader.REFERENCES.fieldName ( ) , ( ( "<" + ( threadId ) ) + ">" ) ) ; } }

Target:
protected void init ( ) throws com.google.gerrit.common.errors.EmailException { super . init ( ) ; setListIdHeader ( ) ; add ( RecipientType.TO , to ) ; if ( ! ( threadId.isEmpty ( ) ) ) { setHeader ( MailHeader.REFERENCES.fieldName ( ) , threadId ) ; } }
Source:
private static java.lang.String describe ( com.google.gerrit.server.CurrentUser user ) { if ( user.isIdentifiedUser ( ) ) { return ( ( com.google.gerrit.server.IdentifiedUser ) ( user ) ) . getAccountId ( ) . toString ( ) ; } if ( user instanceof com.google.gerrit.server.query.change.SingleGroupUser ) { return "group:" + ( ( ( com.google.gerrit.server.query.change.SingleGroupUser ) ( user ) ) . getEffectiveGroups ( ) . getKnownGroups ( ) . iterator ( ) . next ( ) . toString ( ) ) ; } return user.toString ( ) ; }

Target:
private static java.lang.String describe ( com.google.gerrit.server.CurrentUser user ) { if ( user.isIdentifiedUser ( ) ) { return ( ( com.google.gerrit.server.IdentifiedUser ) ( user ) ) . getAccountId ( ) . toString ( ) ; } if ( user instanceof com.google.gerrit.server.query.change.SingleGroupUser ) { return "group:" + ( user.getEffectiveGroups ( ) . getKnownGroups ( ) . iterator ( ) . next ( ) . toString ( ) ) ; } return user.toString ( ) ; }
Source:
private void parseDelete ( final org.eclipse.jgit.transport.ReceiveCommand cmd ) { com.google.gerrit.server.project.RefControl ctl = projectControl.controlForRef ( cmd.getRefName ( ) ) ; if ( ctl.canDelete ( ) ) { cmd.execute ( rp ) ; } else { com.google.gerrit.server.git.ReceiveCommits.reject ( cmd , "can not delete references" ) ; } }

Target:
private void parseDelete ( final org.eclipse.jgit.transport.ReceiveCommand cmd ) { com.google.gerrit.server.project.RefControl ctl = projectControl.controlForRef ( cmd.getRefName ( ) ) ; if ( ctl.canDelete ( ) ) { cmd.execute ( rp ) ; } else { reject ( cmd , "can not delete references" ) ; } }
Source:
protected void allowGlobalCapabilities ( com.google.gerrit.reviewdb.client.AccountGroup.UUID id , java.lang.Iterable < java.lang.String > capabilityNames ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; for ( java.lang.String capabilityName : capabilityNames ) { com.google.gerrit.server.project.Util.allow ( cfg , capabilityName , id ) ; com.google.gerrit.server.project.Util.allow ( cfg , capabilityName , id ) ; } saveProjectConfig ( allProjects , cfg ) ; }

Target:
protected void allowGlobalCapabilities ( com.google.gerrit.reviewdb.client.AccountGroup.UUID id , java.lang.Iterable < java.lang.String > capabilityNames ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; for ( java.lang.String capabilityName : capabilityNames ) { com.google.gerrit.server.project.Util.allow ( cfg , capabilityName , id ) ; } saveProjectConfig ( allProjects , cfg ) ; }
Source:
public void updateFastForward ( com.google.gerrit.reviewdb.client.Project.NameKey name , java.lang.String refName , org.eclipse.jgit.lib.ObjectId oldValue , org.eclipse.jgit.lib.ObjectId newValue ) { com.google.gerrit.server.git.TagCache.EntryVal val = cache.getIfPresent ( name.get ( ) ) ; if ( val != null ) { com.google.gerrit.server.git.TagSetHolder holder = val.holder ; if ( holder != null ) { com.google.gerrit.server.git.TagSet tags = holder.getTagSet ( ) ; if ( tags != null ) { tags.updateFastForward ( refName , oldValue , newValue ) ; } } } }

Target:
public void updateFastForward ( com.google.gerrit.reviewdb.client.Project.NameKey name , java.lang.String refName , org.eclipse.jgit.lib.ObjectId oldValue , org.eclipse.jgit.lib.ObjectId newValue ) { com.google.gerrit.server.git.TagCache.EntryVal val = cache.getIfPresent ( name.get ( ) ) ; if ( val != null ) { com.google.gerrit.server.git.TagSetHolder holder = val.holder ; if ( holder != null ) { com.google.gerrit.server.git.TagSet tags = holder.getTagSet ( ) ; if ( tags != null ) { if ( tags.updateFastForward ( refName , oldValue , newValue ) ) { cache.put ( name.get ( ) , val ) ; } } } } }
Source:
private void renderOwner ( com.google.gerrit.client.changes.ChangeInfo info ) { java.lang.String name = ( ( info.owner ( ) . name ( ) ) != null ) ? info.owner ( ) . name ( ) : com.google.gerrit.client.Gerrit.getConfig ( ) . getAnonymousCowardName ( ) ; ownerText.setInnerText ( name ) ; ownerText.setTitle ( name ) ; }

Target:
private void renderOwner ( com.google.gerrit.client.changes.ChangeInfo info ) { java.lang.String name = ( ( info.owner ( ) . name ( ) ) != null ) ? info.owner ( ) . name ( ) : com.google.gerrit.client.Gerrit.getConfig ( ) . getAnonymousCowardName ( ) ; java.lang.String email = ( ( info.owner ( ) . email ( ) ) != null ) ? info.owner ( ) . email ( ) : name ; ownerText.setInnerText ( name ) ; ownerText.setTitle ( email ) ; }
Source:
public void run ( ) { final com.google.gerrit.reviewdb.server.ReviewDb db ; try { db = database.open ( ) ; } catch ( com.google.gwtorm.server.OrmException e ) { e.printStackTrace ( ) ; return ; } try { for ( ; ; ) { final com.google.gerrit.reviewdb.client.AccountExternalId extId = next ( ) ; if ( extId == null ) { break ; } convertLocalUserToLowerCase ( db , extId ) ; synchronized ( monitor ) { monitor.update ( 1 ) ; } } } finally { db.close ( ) ; } }

Target:
public void run ( ) { try ( com.google.gerrit.reviewdb.server.ReviewDb db = database.open ( ) ) { for ( ; ; ) { final com.google.gerrit.reviewdb.client.AccountExternalId extId = next ( ) ; if ( extId == null ) { break ; } convertLocalUserToLowerCase ( db , extId ) ; synchronized ( monitor ) { monitor.update ( 1 ) ; } } } catch ( com.google.gwtorm.server.OrmException e ) { e.printStackTrace ( ) ; } }
Source:
public java.util.Set < java.lang.String > reviewed ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return com.google.common.collect.ImmutableSet.copyOf ( ( ( java.lang.Iterable < java.lang.String > ) ( listFiles.get ( ) . setReviewed ( true ) . apply ( revision ) . value ( ) ) ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot list reviewed files" , e ) ; } }

Target:
public java.util.Set < java.lang.String > reviewed ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return com.google.common.collect.ImmutableSet.copyOf ( ( ( java.lang.Iterable < java.lang.String > ) ( listFiles.setReviewed ( true ) . apply ( revision ) . value ( ) ) ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot list reviewed files" , e ) ; } }
Source:
private void addDiffChunk ( com.google.gerrit.client.diff.DisplaySide side , int chunkEnd , int otherChunkEnd , int chunkSize , int cmLine , boolean edit ) { chunks.add ( new com.google.gerrit.client.diff.UnifiedDiffChunkInfo ( side , ( ( chunkEnd - chunkSize ) + 1 ) , ( ( otherChunkEnd - chunkSize ) + 1 ) , chunkEnd , cmLine , edit ) ) ; }

Target:
private void addDiffChunk ( com.google.gerrit.client.diff.DisplaySide side , int chunkEnd , int chunkSize , int cmLine , boolean edit ) { chunks.add ( new com.google.gerrit.client.diff.UnifiedDiffChunkInfo ( side , ( ( chunkEnd - chunkSize ) + 1 ) , chunkEnd , cmLine , edit ) ) ; }
Source:
com.googlesource.gerrit.plugins.findowners.OwnersDb get ( org.eclipse.jgit.lib.Repository repository , com.google.gerrit.server.query.change.ChangeData changeData , int patchset ) throws com.google.gwtorm.server.OrmException { java.lang.String branch = changeData.change ( ) . getDest ( ) . get ( ) ; java.lang.String dbKey = com.googlesource.gerrit.plugins.findowners.Cache.makeKey ( changeData.getId ( ) . get ( ) , patchset , branch ) ; return get ( dbKey , repository , branch , changeData.currentFilePaths ( ) ) ; }

Target:
com.googlesource.gerrit.plugins.findowners.OwnersDb get ( org.eclipse.jgit.lib.Repository repository , com.google.gerrit.server.query.change.ChangeData changeData , int patchset ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Project.NameKey project = changeData.change ( ) . getProject ( ) ; java.lang.String branch = changeData.change ( ) . getDest ( ) . get ( ) ; java.lang.String dbKey = com.googlesource.gerrit.plugins.findowners.Cache.makeKey ( changeData.getId ( ) . get ( ) , patchset , branch ) ; return get ( dbKey , repository , project , branch , changeData.currentFilePaths ( ) ) ; }
Source:
static void configure ( org.eclipse.jgit.lib.Config config , java.lang.String port ) { config.setEnum ( "index" , null , "type" , IndexType.ELASTICSEARCH ) ; config.setString ( "index" , null , "protocol" , "http" ) ; config.setString ( "index" , null , "hostname" , "localhost" ) ; config.setString ( "index" , null , "port" , port ) ; config.setBoolean ( "index" , "elasticsearch" , "test" , true ) ; }

Target:
static void configure ( org.eclipse.jgit.lib.Config config , java.lang.String port ) { config.setEnum ( "index" , null , "type" , IndexType.ELASTICSEARCH ) ; config.setString ( "elasticsearch" , "test" , "protocol" , "http" ) ; config.setString ( "elasticsearch" , "test" , "hostname" , "localhost" ) ; config.setString ( "elasticsearch" , "test" , "port" , port ) ; }
Source:
private java.util.List < com.google.gerrit.server.git.CodeReviewCommit > sort ( java.util.Collection < com.google.gerrit.server.git.CodeReviewCommit > toSort ) throws com.google.gerrit.server.git.IntegrationException { try { return new com.google.gerrit.server.git.RebaseSorter ( args.rw , args.mergeTip.getInitialTip ( ) , args.alreadyAccepted , args.canMergeFlag , args.internalChangeQuery , args.changeKindCache , args.repo ) . sort ( toSort ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.IntegrationException ( "Commit sorting failed" , e ) ; } }

Target:
private java.util.List < com.google.gerrit.server.git.CodeReviewCommit > sort ( java.util.Collection < com.google.gerrit.server.git.CodeReviewCommit > toSort ) throws com.google.gerrit.server.git.IntegrationException { try { return new com.google.gerrit.server.git.RebaseSorter ( args.rw , args.mergeTip.getInitialTip ( ) , args.alreadyAccepted , args.canMergeFlag , args.internalChangeQuery ) . sort ( toSort ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.IntegrationException ( "Commit sorting failed" , e ) ; } }
Source:
public java.lang.Void call ( ) throws java.lang.Exception { try { accountCache.evict ( id ) ; index.replace ( accountCache.get ( id ) ) ; if ( ( verboseWriter ) != null ) { verboseWriter.println ( ( "Reindexed " + desc ) ) ; } done.incrementAndGet ( ) ; } catch ( java.lang.Exception e ) { failed.incrementAndGet ( ) ; throw e ; } return null ; }

Target:
public java.lang.Void call ( ) throws java.lang.Exception { try { accountCache.evict ( id ) ; index.replace ( accountCache.get ( id ) ) ; verboseWriter.println ( ( "Reindexed " + desc ) ) ; done.incrementAndGet ( ) ; } catch ( java.lang.Exception e ) { failed.incrementAndGet ( ) ; throw e ; } return null ; }
Source:
public void updateRepo ( com.google.gerrit.server.update.RepoContext ctx ) throws java.lang.Exception { com.google.gerrit.server.git.CodeReviewCommit c = composeGitlinksCommit ( branch ) ; if ( c != null ) { ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( c.getParent ( 0 ) , c , branch.get ( ) ) ) ; addBranchTip ( branch , c ) ; } }

Target:
public void updateRepo ( com.google.gerrit.server.update.RepoContext ctx ) throws java.lang.Exception { com.google.gerrit.server.git.CodeReviewCommit c = composeGitlinksCommit ( branch ) ; if ( c != null ) { ctx.addRefUpdate ( c.getParent ( 0 ) , c , branch.get ( ) ) ; addBranchTip ( branch , c ) ; } }
Source:
protected void setApiHeaders ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , com.google.gitiles.FormatType type ) { res.setContentType ( type.getMimeType ( ) ) ; res.setCharacterEncoding ( com.google.common.base.Charsets.UTF_8.name ( ) ) ; res.setHeader ( com.google.common.net.HttpHeaders.CONTENT_DISPOSITION , "attachment" ) ; res.setHeader ( com.google.common.net.HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN , "*" ) ; setCacheHeaders ( req , res ) ; }

Target:
protected void setApiHeaders ( javax.servlet.http.HttpServletResponse res , com.google.gitiles.FormatType type ) { res.setContentType ( type.getMimeType ( ) ) ; res.setCharacterEncoding ( com.google.common.base.Charsets.UTF_8.name ( ) ) ; res.setHeader ( com.google.common.net.HttpHeaders.CONTENT_DISPOSITION , "attachment" ) ; res.setHeader ( com.google.common.net.HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN , "*" ) ; setCacheHeaders ( res ) ; }
Source:
public static org.eclipse.jgit.merge.ThreeWayMerger newThreeWayMerger ( final org.eclipse.jgit.lib.Repository repo , final org.eclipse.jgit.lib.ObjectInserter inserter , final boolean useContentMerge ) { org.eclipse.jgit.merge.ThreeWayMerger m ; if ( useContentMerge ) { m = MergeStrategy.RESOLVE.newMerger ( repo , true ) ; } else { m = MergeStrategy.SIMPLE_TWO_WAY_IN_CORE.newMerger ( repo ) ; } m.setObjectInserter ( new org.eclipse.jgit.lib.ObjectInserter.Filter ( ) { @ java.lang.Override protected org.eclipse.jgit.lib.ObjectInserter delegate ( ) { return inserter ; } @ java.lang.Override public void flush ( ) { } @ java.lang.Override public void release ( ) { } } ) ; return m ; }

Target:
public org.eclipse.jgit.merge.ThreeWayMerger newThreeWayMerger ( final org.eclipse.jgit.lib.Repository repo , final org.eclipse.jgit.lib.ObjectInserter inserter ) { org.eclipse.jgit.merge.ThreeWayMerger m ; if ( useContentMerge ) { m = MergeStrategy.RESOLVE.newMerger ( repo , true ) ; } else { m = MergeStrategy.SIMPLE_TWO_WAY_IN_CORE.newMerger ( repo ) ; } m.setObjectInserter ( new org.eclipse.jgit.lib.ObjectInserter.Filter ( ) { @ java.lang.Override protected org.eclipse.jgit.lib.ObjectInserter delegate ( ) { return inserter ; } @ java.lang.Override public void flush ( ) { } @ java.lang.Override public void release ( ) { } } ) ; return m ; }
Source:
private static org.apache.lucene.search.Query exactQuery ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p ) { if ( p instanceof com.google.gerrit.server.index.RegexPredicate < ? > ) { return com.google.gerrit.lucene.QueryBuilder.regexQuery ( p ) ; } else { return new org.apache.lucene.search.TermQuery ( new org.apache.lucene.index.Term ( p.getField ( ) . getName ( ) , p.getValue ( ) ) ) ; } }

Target:
private org.apache.lucene.search.Query exactQuery ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p ) { if ( p instanceof com.google.gerrit.server.index.RegexPredicate < ? > ) { return regexQuery ( p ) ; } else { return new org.apache.lucene.search.TermQuery ( new org.apache.lucene.index.Term ( p.getField ( ) . getName ( ) , p.getValue ( ) ) ) ; } }
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 ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; }

Target:
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 ) ; }
Source:
public void testNotNot ( ) { final com.google.gerrit.server.query.NotPredicateTest.TestPredicate p = com.google.gerrit.server.query.NotPredicateTest.f ( "author" , "bob" ) ; final com.google.gerrit.server.query.Predicate < java.lang.String > n = com.google.gerrit.server.query.Predicate.not ( p ) ; assertTrue ( ( n instanceof com.google.gerrit.server.query.NotPredicate ) ) ; assertNotSame ( p , n ) ; assertSame ( p , com.google.gerrit.server.query.Predicate.not ( n ) ) ; }

Target:
public void testNotNot ( ) { final com.google.gerrit.server.query.NotPredicateTest.TestPredicate p = com.google.gerrit.server.query.NotPredicateTest.f ( "author" , "bob" ) ; final com.google.gerrit.server.query.Predicate < java.lang.String > n = com.google.gerrit.server.query.Predicate.not ( p ) ; org.junit.Assert.assertTrue ( ( n instanceof com.google.gerrit.server.query.NotPredicate ) ) ; org.junit.Assert.assertNotSame ( p , n ) ; org.junit.Assert.assertSame ( p , com.google.gerrit.server.query.Predicate.not ( n ) ) ; }
Source:
public void uploadPackSubsetOfBranchesVisibleIncludingHead ( ) throws java.lang.Exception { allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/master" ) ; deny ( "refs/heads/branch" , Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; setApiUser ( user ) ; assertUploadPackRefs ( "HEAD" , ( ( r1 ) + "1" ) , ( ( r1 ) + "meta" ) , ( ( r3 ) + "1" ) , ( ( r3 ) + "meta" ) , "refs/heads/master" , "refs/tags/master-tag" ) ; }

Target:
public void uploadPackSubsetOfBranchesVisibleIncludingHead ( ) throws java.lang.Exception { allow ( "refs/heads/master" , Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; deny ( "refs/heads/branch" , Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; setApiUser ( user ) ; assertUploadPackRefs ( "HEAD" , ( ( r1 ) + "1" ) , ( ( r1 ) + "meta" ) , ( ( r3 ) + "1" ) , ( ( r3 ) + "meta" ) , "refs/heads/master" , "refs/tags/master-tag" ) ; }
Source:
public com.google.gerrit.rules.PrologEnvironment newPrologEnvironment ( ) throws com.googlecode.prolog_cafe.exceptions.CompileException { com.googlecode.prolog_cafe.lang.PrologMachineCopy pmc = rulesMachine ; if ( pmc == null ) { pmc = rulesCache.loadMachine ( getProject ( ) . getNameKey ( ) , config.getRulesId ( ) ) ; rulesMachine = pmc ; } return envFactory.create ( pmc ) ; }

Target:
public com.google.gerrit.rules.PrologEnvironment newPrologEnvironment ( ) throws com.googlecode.prolog_cafe.exceptions.CompileException { com.googlecode.prolog_cafe.lang.PrologMachineCopy pmc = rulesMachine ; if ( pmc == null ) { pmc = rulesCache.loadMachine ( getNameKey ( ) , config.getRulesId ( ) ) ; rulesMachine = pmc ; } return envFactory.create ( pmc ) ; }
Source:
private int insertRow ( final int beforeRow ) { for ( final com.google.gerrit.client.changes.ChangeTable.Section s : sections ) { boolean dirty = false ; if ( beforeRow <= ( s.titleRow ) ) { ( s.titleRow ) ++ ; } if ( beforeRow < ( s.dataBegin ) ) { ( s.dataBegin ) ++ ; } } return table.insertRow ( beforeRow ) ; }

Target:
private int insertRow ( final int beforeRow ) { for ( final com.google.gerrit.client.changes.ChangeTable.Section s : sections ) { if ( beforeRow <= ( s.titleRow ) ) { ( s.titleRow ) ++ ; } if ( beforeRow < ( s.dataBegin ) ) { ( s.dataBegin ) ++ ; } } return table.insertRow ( beforeRow ) ; }
Source:
private void savePatchSet ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException { patchSet = ctx.getDb ( ) . patchSets ( ) . get ( psId ) ; if ( ! ( patchSet.isDraft ( ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "Patch set is not a draft" ) ; } patchSet.setDraft ( false ) ; }

Target:
private void savePatchSet ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException { patchSet = ctx.getDb ( ) . patchSets ( ) . get ( psId ) ; if ( ! ( patchSet.isDraft ( ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "Patch set is not a draft" ) ; } patchSet.setDraft ( false ) ; ctx.getDb ( ) . patchSets ( ) . update ( java.util.Collections.singleton ( patchSet ) ) ; }
Source:
public void parseNoteDbPrimary ( ) { com.google.gerrit.server.notedb.NoteDbChangeState state = com.google.gerrit.server.notedb.NoteDbChangeState.parse ( new com.google.gerrit.reviewdb.client.Change.Id ( 1 ) , "N" ) ; com.google.common.truth.Truth.assertThat ( state.getPrimaryStorage ( ) ) . isEqualTo ( PrimaryStorage.NOTE_DB ) ; com.google.common.truth.Truth.assertThat ( state.getRefState ( ) . isPresent ( ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( state.getReadOnlyUntil ( ) . isPresent ( ) ) . isFalse ( ) ; }

Target:
public void parseNoteDbPrimary ( ) { com.google.gerrit.server.notedb.NoteDbChangeState state = com.google.gerrit.server.notedb.NoteDbChangeState.parse ( new com.google.gerrit.reviewdb.client.Change.Id ( 1 ) , "N" ) ; com.google.common.truth.Truth.assertThat ( state.getPrimaryStorage ( ) ) . isEqualTo ( PrimaryStorage.NOTE_DB ) ; com.google.common.truth.Truth.assertThat ( state.getRefState ( ) ) . isEmpty ( ) ; com.google.common.truth.Truth.assertThat ( state.getReadOnlyUntil ( ) ) . isEmpty ( ) ; }
Source:
private org.eclipse.jgit.lib.Repository openRepository ( final com.google.gerrit.reviewdb.Project.NameKey name ) { try { return repoManager.openRepository ( name.get ( ) ) ; } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException err ) { com.google.gerrit.common.ChangeHookRunner.log.warn ( ( "Cannot open repository " + ( name.get ( ) ) ) , err ) ; return null ; } }

Target:
private org.eclipse.jgit.lib.Repository openRepository ( final com.google.gerrit.reviewdb.Project.NameKey name ) { try { return repoManager.openRepository ( name ) ; } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException err ) { com.google.gerrit.common.ChangeHookRunner.log.warn ( ( "Cannot open repository " + ( name.get ( ) ) ) , err ) ; return null ; } }
Source:
public void fire ( com.google.gerrit.reviewdb.client.Project.NameKey project , org.eclipse.jgit.lib.BatchRefUpdate batchRefUpdate ) { for ( org.eclipse.jgit.transport.ReceiveCommand cmd : batchRefUpdate.getCommands ( ) ) { if ( ( cmd.getResult ( ) ) == ( ReceiveCommand.Result.OK ) ) { fire ( project , cmd.getRefName ( ) , cmd.getOldId ( ) , cmd.getNewId ( ) ) ; } } }

Target:
public void fire ( com.google.gerrit.reviewdb.client.Project.NameKey project , org.eclipse.jgit.lib.BatchRefUpdate batchRefUpdate ) { for ( org.eclipse.jgit.transport.ReceiveCommand cmd : batchRefUpdate.getCommands ( ) ) { if ( ( cmd.getResult ( ) ) == ( ReceiveCommand.Result.OK ) ) { fire ( project , cmd ) ; } } }
Source:
public void rebase ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; gApi.changes ( ) . id ( ( "p~master~" + ( r.getChangeId ( ) ) ) ) . revision ( r.getCommit ( ) . name ( ) ) . rebase ( ) ; }

Target:
public void rebase ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; gApi.changes ( ) . id ( r.getChangeId ( ) ) . revision ( r.getCommit ( ) . name ( ) ) . rebase ( ) ; }
Source:
public void run ( ) { try { future.get ( ) ; } catch ( java.lang.InterruptedException e ) { fail ( project , e ) ; } catch ( java.util.concurrent.ExecutionException e ) { ok.set ( false ) ; } catch ( java.lang.RuntimeException e ) { failAndThrow ( project , e ) ; } catch ( java.lang.Error e ) { failAndThrow ( project , e ) ; } finally { projTask.update ( 1 ) ; } }

Target:
public void run ( ) { try { future.get ( ) ; } catch ( java.lang.InterruptedException e ) { fail ( project , e ) ; } catch ( java.util.concurrent.ExecutionException e ) { fail ( project , e ) ; } catch ( java.lang.RuntimeException e ) { failAndThrow ( project , e ) ; } catch ( java.lang.Error e ) { failAndThrow ( project , e ) ; } finally { projTask.update ( 1 ) ; } }
Source:
public static com.google.gerrit.client.rpc.RestApi actions ( int id , java.lang.String revision ) { if ( ( revision == null ) || ( revision.equals ( "" ) ) ) { revision = "current" ; } return com.google.gerrit.client.changes.ChangeApi.call ( id , revision , "actions" ) ; }

Target:
public static com.google.gerrit.client.rpc.RestApi actions ( @ com.google.gerrit.common.Nullable java.lang.String project , int id , java.lang.String revision ) { if ( ( revision == null ) || ( revision.equals ( "" ) ) ) { revision = "current" ; } return com.google.gerrit.client.changes.ChangeApi.call ( project , id , revision , "actions" ) ; }
Source:
private boolean includedInOne ( final java.util.Collection < org.eclipse.jgit.lib.Ref > refs ) throws java.io.IOException { parseCommits ( refs ) ; java.util.List < org.eclipse.jgit.revwalk.RevCommit > before = new java.util.LinkedList < > ( ) ; java.util.List < org.eclipse.jgit.revwalk.RevCommit > after = new java.util.LinkedList < > ( ) ; partition ( before , after ) ; rw.reset ( ) ; return ( ! ( includedIn ( after , 1 ) . isEmpty ( ) ) ) || ( ! ( includedIn ( before , 1 ) . isEmpty ( ) ) ) ; }

Target:
private boolean includedInOne ( final java.util.Collection < org.eclipse.jgit.lib.Ref > refs ) throws java.io.IOException { parseCommits ( refs ) ; java.util.List < org.eclipse.jgit.revwalk.RevCommit > before = new java.util.ArrayList < > ( ) ; java.util.List < org.eclipse.jgit.revwalk.RevCommit > after = new java.util.ArrayList < > ( ) ; partition ( before , after ) ; rw.reset ( ) ; return ( ! ( includedIn ( after , 1 ) . isEmpty ( ) ) ) || ( ! ( includedIn ( before , 1 ) . isEmpty ( ) ) ) ; }
Source:
public void testSelectMIXED ( ) { setFrom ( "MIXED" ) ; assertTrue ( ( ( create ( ) ) instanceof com.google.gerrit.server.mail.FromAddressGeneratorProvider.PatternGen ) ) ; setFrom ( "mixed" ) ; assertTrue ( ( ( create ( ) ) instanceof com.google.gerrit.server.mail.FromAddressGeneratorProvider.PatternGen ) ) ; setFrom ( "mIxEd" ) ; assertTrue ( ( ( create ( ) ) instanceof com.google.gerrit.server.mail.FromAddressGeneratorProvider.PatternGen ) ) ; }

Target:
public void testSelectMIXED ( ) { setFrom ( "MIXED" ) ; org.junit.Assert.assertTrue ( ( ( create ( ) ) instanceof com.google.gerrit.server.mail.FromAddressGeneratorProvider.PatternGen ) ) ; setFrom ( "mixed" ) ; org.junit.Assert.assertTrue ( ( ( create ( ) ) instanceof com.google.gerrit.server.mail.FromAddressGeneratorProvider.PatternGen ) ) ; setFrom ( "mIxEd" ) ; org.junit.Assert.assertTrue ( ( ( create ( ) ) instanceof com.google.gerrit.server.mail.FromAddressGeneratorProvider.PatternGen ) ) ; }
Source:
public boolean accept ( java.io.File pathname ) { java.lang.String n = pathname.getName ( ) ; return ( ( ( ( com.google.gerrit.server.plugins.PluginLoader.isJarPlugin ( n ) ) || ( com.google.gerrit.server.plugins.PluginLoader.isJsPlugin ( n ) ) ) && ( ! ( n.startsWith ( ".last_" ) ) ) ) && ( ! ( n.startsWith ( ".next_" ) ) ) ) && ( pathname.isFile ( ) ) ; }

Target:
public boolean accept ( java.io.File pathname ) { java.lang.String n = pathname.getName ( ) ; return ( ! ( n.startsWith ( ".last_" ) ) ) && ( ! ( n.startsWith ( ".next_" ) ) ) ; }
Source:
private com.google.gerrit.server.account.AuthResult byPreferredEmail ( final java.lang.String email ) { try { final com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ; try { java.util.List < com.google.gerrit.reviewdb.client.Account > matches = db.accounts ( ) . byPreferredEmail ( email ) . toList ( ) ; return ( matches.size ( ) ) == 1 ? auth ( matches.get ( 0 ) ) : null ; } finally { db.close ( ) ; } } catch ( com.google.gwtorm.server.OrmException e ) { getServletContext ( ) . log ( "cannot query database" , e ) ; return null ; } }

Target:
private com.google.gerrit.server.account.AuthResult byPreferredEmail ( final java.lang.String email ) { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { java.util.List < com.google.gerrit.reviewdb.client.Account > matches = db.accounts ( ) . byPreferredEmail ( email ) . toList ( ) ; return ( matches.size ( ) ) == 1 ? auth ( matches.get ( 0 ) ) : null ; } catch ( com.google.gwtorm.server.OrmException e ) { getServletContext ( ) . log ( "cannot query database" , e ) ; return null ; } }
Source:
public java.util.Optional < com.google.gerrit.server.account.AccountState > getByUsername ( java.lang.String username ) { try { com.google.gerrit.server.account.externalids.ExternalId extId = externalIds.get ( ExternalId.Key.create ( com.google.gerrit.server.account.externalids.ExternalId.SCHEME_USERNAME , username ) ) ; if ( extId == null ) { return java.util.Optional.empty ( ) ; } return maybeGet ( extId.accountId ( ) ) ; } catch ( java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException e ) { com.google.gerrit.server.account.AccountCacheImpl.log.warn ( ( "Cannot load AccountState for username " + username ) , e ) ; return null ; } }

Target:
public java.util.Optional < com.google.gerrit.server.account.AccountState > getByUsername ( java.lang.String username ) { try { com.google.gerrit.server.account.externalids.ExternalId extId = externalIds.get ( ExternalId.Key.create ( com.google.gerrit.server.account.externalids.ExternalId.SCHEME_USERNAME , username ) ) ; if ( extId == null ) { return java.util.Optional.empty ( ) ; } return get ( extId.accountId ( ) ) ; } catch ( java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException e ) { com.google.gerrit.server.account.AccountCacheImpl.log.warn ( ( "Cannot load AccountState for username " + username ) , e ) ; return null ; } }
Source:
private java.util.Collection < com.google.gerrit.server.config.ListCaches.CacheInfo > getCaches ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Map < java.lang.String , com.google.gerrit.server.config.ListCaches.CacheInfo > caches = ( ( java.util.Map < java.lang.String , com.google.gerrit.server.config.ListCaches.CacheInfo > ) ( listCaches.get ( ) . apply ( new com.google.gerrit.server.config.ConfigResource ( ) ) ) ) ; for ( java.util.Map.Entry < java.lang.String , com.google.gerrit.server.config.ListCaches.CacheInfo > entry : caches.entrySet ( ) ) { com.google.gerrit.server.config.ListCaches.CacheInfo cache = entry.getValue ( ) ; cache.name = entry.getKey ( ) ; } return caches.values ( ) ; }

Target:
private java.util.Collection < com.google.gerrit.server.config.ListCaches.CacheInfo > getCaches ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Map < java.lang.String , com.google.gerrit.server.config.ListCaches.CacheInfo > caches = ( ( java.util.Map < java.lang.String , com.google.gerrit.server.config.ListCaches.CacheInfo > ) ( listCaches.apply ( new com.google.gerrit.server.config.ConfigResource ( ) ) ) ) ; for ( java.util.Map.Entry < java.lang.String , com.google.gerrit.server.config.ListCaches.CacheInfo > entry : caches.entrySet ( ) ) { com.google.gerrit.server.config.ListCaches.CacheInfo cache = entry.getValue ( ) ; cache.name = entry.getKey ( ) ; } return caches.values ( ) ; }
Source:
private java.lang.String url ( ) { if ( ( info.hasChangeNumber ( ) ) && ( ( info._changeNumber ( ) ) == 0 ) ) { return null ; } if ( ( info.hasChangeNumber ( ) ) && ( info.hasRevisionNumber ( ) ) ) { return "#" + ( com.google.gerrit.common.PageLinks.toChange ( info.patchSetId ( ) ) ) ; } return null ; }

Target:
private java.lang.String url ( ) { if ( ( info.hasChangeNumber ( ) ) && ( info.hasRevisionNumber ( ) ) ) { return "#" + ( com.google.gerrit.common.PageLinks.toChange ( info.patchSetId ( ) ) ) ; } return null ; }
Source:
public void start ( ) { synchronized ( lock ) { if ( ( manager ) != null ) { throw new java.lang.IllegalStateException ( "Cache pool has already been started" ) ; } manager = new net.sf.ehcache.CacheManager ( new com.google.gerrit.server.cache.CachePool.Factory ( ) . toConfiguration ( ) ) ; for ( com.google.gerrit.server.cache.CacheProvider < ? , ? > p : caches.values ( ) ) { p.bind ( manager.getEhcache ( p.getName ( ) ) ) ; } } }

Target:
private void start ( ) { synchronized ( lock ) { if ( ( manager ) != null ) { throw new java.lang.IllegalStateException ( "Cache pool has already been started" ) ; } manager = new net.sf.ehcache.CacheManager ( new com.google.gerrit.server.cache.CachePool.Factory ( ) . toConfiguration ( ) ) ; for ( com.google.gerrit.server.cache.CacheProvider < ? , ? > p : caches.values ( ) ) { p.bind ( manager.getEhcache ( p.getName ( ) ) ) ; } } }
Source:
public com.google.gerrit.server.project.ChangeControl changeControl ( com.google.gerrit.server.CurrentUser user ) throws com.google.gwtorm.server.OrmException { if ( ( changeControl ) != null ) { throw new java.lang.IllegalStateException ( ( "user already specified: " + ( changeControl.getUser ( ) ) ) ) ; } try { if ( ( change ) != null ) { changeControl = changeControlFactory.controlFor ( change , user ) ; } else { changeControl = changeControlFactory.controlFor ( legacyId , user ) ; } } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } return changeControl ; }

Target:
public com.google.gerrit.server.project.ChangeControl changeControl ( com.google.gerrit.server.CurrentUser user ) throws com.google.gwtorm.server.OrmException { if ( ( changeControl ) != null ) { throw new java.lang.IllegalStateException ( ( "user already specified: " + ( changeControl.getUser ( ) ) ) ) ; } try { if ( ( change ) != null ) { changeControl = changeControlFactory.controlFor ( change , user ) ; } else { changeControl = changeControlFactory.controlFor ( project , legacyId , user ) ; } } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } return changeControl ; }
Source:
private void deleteOrUpdateDraftChange ( com.google.gerrit.server.update.ChangeContext ctx ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.Change c = ctx.getChange ( ) ; if ( deletedOnlyPatchSet ( ) ) { deleteChangeOp = deleteChangeOpProvider.get ( ) ; deleteChangeOp.updateChange ( ctx ) ; return ; } if ( c.currentPatchSetId ( ) . equals ( psId ) ) { c.setCurrentPatchSet ( previousPatchSetInfo ( ctx ) ) ; } }

Target:
private void deleteOrUpdateDraftChange ( com.google.gerrit.server.update.ChangeContext ctx , java.util.Map < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSet > patchSets ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.Change c = ctx.getChange ( ) ; if ( deletedOnlyPatchSet ( ) ) { deleteChangeOp = deleteChangeOpProvider.get ( ) ; deleteChangeOp.updateChange ( ctx ) ; return ; } if ( c.currentPatchSetId ( ) . equals ( psId ) ) { c.setCurrentPatchSet ( previousPatchSetInfo ( ctx , patchSets ) ) ; } }
Source:
public void delete ( com.google.gerrit.reviewdb.client.Change.Id id ) throws java.io.IOException { org.apache.lucene.index.Term idTerm = com.google.gerrit.lucene.QueryBuilder.idTerm ( id ) ; try { com.google.common.util.concurrent.Futures.allAsList ( openIndex.delete ( idTerm ) , closedIndex.delete ( idTerm ) ) . get ( ) ; } catch ( java.util.concurrent.ExecutionException | java.lang.InterruptedException e ) { throw new java.io.IOException ( e ) ; } }

Target:
public void delete ( com.google.gerrit.reviewdb.client.Change.Id id ) throws java.io.IOException { org.apache.lucene.index.Term idTerm = com.google.gerrit.lucene.QueryBuilder.idTerm ( schema , id ) ; try { com.google.common.util.concurrent.Futures.allAsList ( openIndex.delete ( idTerm ) , closedIndex.delete ( idTerm ) ) . get ( ) ; } catch ( java.util.concurrent.ExecutionException | java.lang.InterruptedException e ) { throw new java.io.IOException ( e ) ; } }
Source:
public com.google.gerrit.server.account.AccountInfo apply ( com.google.gerrit.server.group.GroupResource resource , com.google.gerrit.server.group.AddMembers.PutMember.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.UnprocessableEntityException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.group.AddMembers.Input in = new com.google.gerrit.server.group.AddMembers.Input ( ) ; in._oneMember = id ; java.util.List < com.google.gerrit.server.account.AccountInfo > list = put.get ( ) . apply ( resource , in ) ; if ( ( list.size ( ) ) == 1 ) { return list.get ( 0 ) ; } throw new java.lang.IllegalStateException ( ) ; }

Target:
public com.google.gerrit.server.account.AccountInfo apply ( com.google.gerrit.server.group.GroupResource resource , com.google.gerrit.server.group.AddMembers.PutMember.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.UnprocessableEntityException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.group.AddMembers.Input in = new com.google.gerrit.server.group.AddMembers.Input ( ) ; in._oneMember = id ; java.util.List < com.google.gerrit.server.account.AccountInfo > list = put.apply ( resource , in ) ; if ( ( list.size ( ) ) == 1 ) { return list.get ( 0 ) ; } throw new java.lang.IllegalStateException ( ) ; }
Source:
private Project.NameKey getProjectName ( java.nio.file.Path p ) { java.lang.String projectName = startFolder.relativize ( p ) . toString ( ) ; if ( ( java.io.File.separatorChar ) != '/' ) { projectName = projectName.replace ( java.io.File.separatorChar , '/' ) ; } if ( projectName.endsWith ( Constants.DOT_GIT_EXT ) ) { int newLen = ( projectName.length ( ) ) - ( Constants.DOT_GIT_EXT.length ( ) ) ; projectName = projectName.substring ( 0 , newLen ) ; } return new com.google.gerrit.reviewdb.client.Project.NameKey ( projectName ) ; }

Target:
private static Project.NameKey getProjectName ( java.nio.file.Path startFolder , java.nio.file.Path p ) { java.lang.String projectName = startFolder.relativize ( p ) . toString ( ) ; if ( ( java.io.File.separatorChar ) != '/' ) { projectName = projectName.replace ( java.io.File.separatorChar , '/' ) ; } if ( projectName.endsWith ( Constants.DOT_GIT_EXT ) ) { int newLen = ( projectName.length ( ) ) - ( Constants.DOT_GIT_EXT.length ( ) ) ; projectName = projectName.substring ( 0 , newLen ) ; } return new com.google.gerrit.reviewdb.client.Project.NameKey ( projectName ) ; }
Source:
public void setAssigneeOnReviewableChangeByAdmin ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , admin , sc.assignee ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer , admin ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) . to ( sc.assignee ) ; }

Target:
public void setAssigneeOnReviewableChangeByAdmin ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , admin , sc.assignee ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer , admin ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . to ( sc.assignee ) ; }
Source:
java.util.Map < java.lang.String , ? > buildData ( javax.servlet.http.HttpServletRequest req ) throws java.io.IOException { com.google.gitiles.RepositoryDescription desc = accessFactory.forRequest ( req ) . getRepositoryDescription ( ) ; return com.google.common.collect.ImmutableMap.of ( "cloneUrl" , desc.cloneUrl , "description" , com.google.common.base.Strings.nullToEmpty ( desc.description ) , "branches" , getRefs ( req , Constants.R_HEADS , com.google.common.collect.Ordering.from ( RefComparator.INSTANCE ) ) , "tags" , getRefs ( req , Constants.R_TAGS , tagComparator ( req ) ) ) ; }

Target:
java.util.Map < java.lang.String , ? > buildData ( javax.servlet.http.HttpServletRequest req ) throws java.io.IOException { com.google.gitiles.RepositoryDescription desc = accessFactory.forRequest ( req ) . getRepositoryDescription ( ) ; return com.google.common.collect.ImmutableMap.of ( "cloneUrl" , desc.cloneUrl , "description" , com.google.common.base.Strings.nullToEmpty ( desc.description ) , "branches" , getRefs ( req , Constants.R_HEADS ) , "tags" , getRefs ( req , Constants.R_TAGS ) ) ; }