auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setAssigneeOnReviewableChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , sc.owner , sc.assignee ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) . to ( sc.assignee ) ; }

Target:
public void setAssigneeOnReviewableChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , sc.owner , sc.assignee ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . to ( sc.assignee ) ; }
Source:
public void stop ( ) { I read = searchIndex.get ( ) ; if ( read != null ) { read.close ( ) ; } for ( I write : writeIndexes ) { if ( write != read ) { write.close ( ) ; } } }

Target:
public void stop ( ) { I read = searchIndex.get ( ) ; if ( read != null ) { read.close ( ) ; } for ( I write : writeIndexes ) { if ( write != read ) { write.stop ( ) ; write.close ( ) ; } } }
Source:
private static java.util.List < com.google.gerrit.reviewdb.client.PatchLineComment > commentsOnPatchSet ( java.util.Collection < com.google.gerrit.reviewdb.client.PatchLineComment > allComments , com.google.gerrit.reviewdb.client.PatchSet.Id psId ) { java.util.List < com.google.gerrit.reviewdb.client.PatchLineComment > result = new java.util.ArrayList ( allComments.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : allComments ) { if ( com.google.gerrit.server.notedb.CommentsInNotesUtil.getCommentPsId ( c ) . equals ( psId ) ) { result.add ( c ) ; } } return com.google.gerrit.server.PatchLineCommentsUtil.sort ( result ) ; }

Target:
private static java.util.List < com.google.gerrit.reviewdb.client.PatchLineComment > commentsOnPatchSet ( java.util.Collection < com.google.gerrit.reviewdb.client.PatchLineComment > allComments , com.google.gerrit.reviewdb.client.PatchSet.Id psId ) { java.util.List < com.google.gerrit.reviewdb.client.PatchLineComment > result = new java.util.ArrayList ( allComments.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : allComments ) { if ( com.google.gerrit.server.PatchLineCommentsUtil.getCommentPsId ( c ) . equals ( psId ) ) { result.add ( c ) ; } } return com.google.gerrit.server.PatchLineCommentsUtil.sort ( result ) ; }
Source:
private com.google.gerrit.server.notedb.ChangeNotes createFromChangeOnlyWhenNoteDbDisabled ( com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkState ( ( ! ( args.migration.readChanges ( ) ) ) , ( "do not call" + " createFromChangeWhenNoteDbDisabled when NoteDb is enabled" ) ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( args , change.getProject ( ) , change ) . load ( ) ; }

Target:
private com.google.gerrit.server.notedb.ChangeNotes createFromChangeOnlyWhenNoteDbDisabled ( com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkState ( ( ! ( args.migration.readChanges ( ) ) ) , ( "do not call" + " createFromChangeWhenNoteDbDisabled when NoteDb is enabled" ) ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( args , change ) . load ( ) ; }
Source:
private java.lang.String getAccessTokenAttribute ( java.lang.String tokenResponse ) throws com.googlesource.gerrit.plugins.cfoauth.UAAClientException { if ( com.google.common.base.Strings.isNullOrEmpty ( tokenResponse ) ) { throw new com.googlesource.gerrit.plugins.cfoauth.UAAClientException ( "Can't extract a token from an empty string" ) ; } com.google.gson.JsonObject json = getAsJsonObject ( tokenResponse ) ; java.lang.String accessToken = getAttribute ( json , com.googlesource.gerrit.plugins.cfoauth.UAAClient.ACCESS_TOKEN_ATTRIBUTE ) ; if ( accessToken == null ) { throw new com.googlesource.gerrit.plugins.cfoauth.UAAClientException ( "Can't extract a token: missing or invalid 'access_token' attribute" ) ; } return accessToken ; }

Target:
private java.lang.String getAccessTokenAttribute ( java.lang.String tokenResponse ) throws com.googlesource.gerrit.plugins.cfoauth.UAAClientException { com.google.gson.JsonObject json = getAsJsonObject ( tokenResponse ) ; java.lang.String accessToken = getAttribute ( json , com.googlesource.gerrit.plugins.cfoauth.UAAClient.ACCESS_TOKEN_ATTRIBUTE ) ; if ( accessToken == null ) { throw new com.googlesource.gerrit.plugins.cfoauth.UAAClientException ( "Can't extract a token: missing or invalid 'access_token' attribute" ) ; } return accessToken ; }
Source:
public void testBulletList5 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.html ( ( "To see this bug,\n" + ( ( "you have to:\n" + "* Be on IMAP or EAS (not on POP)\n" ) + "* Be very unlucky\n" ) ) ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; assertNotSame ( o , n ) ; assertEquals ( ( ( ( ( "<p>To see this bug, you have to:</p>" + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.BEGIN_LIST ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "Be on IMAP or EAS (not on POP)" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "Be very unlucky" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.END_LIST ) ) , n.asString ( ) ) ; }

Target:
public void testBulletList5 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.html ( ( "To see this bug,\n" + ( ( "you have to:\n" + "* Be on IMAP or EAS (not on POP)\n" ) + "* Be very unlucky\n" ) ) ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; org.junit.Assert.assertNotSame ( o , n ) ; org.junit.Assert.assertEquals ( ( ( ( ( "<p>To see this bug, you have to:</p>" + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.BEGIN_LIST ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "Be on IMAP or EAS (not on POP)" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "Be very unlucky" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.END_LIST ) ) , n.asString ( ) ) ; }
Source:
public void name ( java.lang.String name ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.group.PutName.Input in = new com.google.gerrit.server.group.PutName.Input ( ) ; in.name = name ; try { putName.apply ( rsrc , in ) ; } catch ( com.google.gerrit.common.errors.NoSuchGroupException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( name , e ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot put group name" , e ) ; } }

Target:
public void name ( java.lang.String name ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.group.PutName.Input in = new com.google.gerrit.server.group.PutName.Input ( ) ; in.name = name ; try { putName.apply ( rsrc , in ) ; } catch ( com.google.gerrit.common.errors.NoSuchGroupException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( name , e ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot put group name" , e ) ; } }
Source:
protected void assertMerged ( com.google.gerrit.acceptance.PushOneCommit.Result change ) throws com.google.gerrit.extensions.restapi.RestApiException { java.lang.String changeId = change.getChangeId ( ) ; com.google.gerrit.extensions.client.ChangeStatus status = gApi.changes ( ) . id ( changeId ) . info ( ) . status ; com.google.common.truth.Truth.assertThat ( status ) . isEqualTo ( ChangeStatus.MERGED ) ; }

Target:
protected void assertMerged ( java.lang.String changeId ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.extensions.client.ChangeStatus status = gApi.changes ( ) . id ( changeId ) . info ( ) . status ; com.google.common.truth.Truth.assertThat ( status ) . isEqualTo ( ChangeStatus.MERGED ) ; }
Source:
public void start ( ) { queue.start ( ) ; if ( ( ( srvInfo.getState ( ) ) == ( ServerInformation.State.STARTUP ) ) && ( config.isReplicateAllOnPluginStart ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationState state = new com.googlesource.gerrit.plugins.replication.ReplicationState ( new com.googlesource.gerrit.plugins.replication.PushResultProcessing.GitUpdateProcessing ( eventDispatcher.get ( ) ) ) ; pushAllFuture.set ( pushAll.create ( null , com.googlesource.gerrit.plugins.replication.ReplicationFilter.all ( ) , state ) . schedule ( 30 , java.util.concurrent.TimeUnit.SECONDS ) ) ; } }

Target:
public void start ( ) { queue.start ( ) ; if ( ( ( srvInfo.getState ( ) ) == ( ServerInformation.State.STARTUP ) ) && ( config.isReplicateAllOnPluginStart ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationState state = new com.googlesource.gerrit.plugins.replication.ReplicationState ( new com.googlesource.gerrit.plugins.replication.PushResultProcessing.GitUpdateProcessing ( eventDispatcher.get ( ) ) ) ; pushAllFuture.set ( pushAll.create ( null , com.googlesource.gerrit.plugins.replication.ReplicationFilter.all ( ) , state , false ) . schedule ( 30 , java.util.concurrent.TimeUnit.SECONDS ) ) ; } }
Source:
public void commentOnReviewableChangeByOwnerNotifyOwnerReviewers ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; review ( sc.owner , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED , com.google.gerrit.extensions.api.changes.NotifyHandling.OWNER_REVIEWERS ) ; assertThat ( sender ) . sent ( "comment" , sc ) . to ( sc.reviewerByEmail ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.ccerByEmail ) . notTo ( sc.owner , sc.starrer ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void commentOnReviewableChangeByOwnerNotifyOwnerReviewers ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; review ( sc.owner , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED , com.google.gerrit.extensions.api.changes.NotifyHandling.OWNER_REVIEWERS ) ; assertThat ( sender ) . sent ( "comment" , sc ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( sc.owner , sc.starrer ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }
Source:
private void setMerged ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , com.google.gerrit.reviewdb.client.ChangeMessage msg ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = ctx.getChange ( ) ; com.google.gerrit.reviewdb.server.ReviewDb db = ctx.getDb ( ) ; logDebug ( "Setting change merged" , c.getId ( ) ) ; c.setStatus ( Change.Status.MERGED ) ; c.setSubmissionId ( args.submissionId ) ; ctx.saveChange ( ) ; if ( msg != null ) { args.cmUtil.addChangeMessage ( db , ctx.getUpdate ( msg.getPatchSetId ( ) ) , msg ) ; } }

Target:
private void setMerged ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , com.google.gerrit.reviewdb.client.ChangeMessage msg ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = ctx.getChange ( ) ; com.google.gerrit.reviewdb.server.ReviewDb db = ctx.getDb ( ) ; logDebug ( "Setting change merged" , c.getId ( ) ) ; c.setStatus ( Change.Status.MERGED ) ; c.setSubmissionId ( args.submissionId ) ; if ( msg != null ) { args.cmUtil.addChangeMessage ( db , ctx.getUpdate ( msg.getPatchSetId ( ) ) , msg ) ; } }
Source:
private void addMissingLabel ( java.lang.String text ) { com.google.gwt.user.client.Element li = com.google.gwt.user.client.DOM.createElement ( "li" ) ; li.setClassName ( Gerrit.RESOURCES.css ( ) . missingApproval ( ) ) ; com.google.gwt.user.client.DOM.setInnerText ( li , text ) ; com.google.gwt.user.client.DOM.appendChild ( missing.getElement ( ) , li ) ; }

Target:
private void addMissingLabel ( java.lang.String text ) { com.google.gwt.user.client.Element li = com.google.gwt.user.client.DOM.createElement ( "li" ) ; li.setClassName ( Gerrit.RESOURCES.css ( ) . missingApproval ( ) ) ; li.setInnerText ( text ) ; com.google.gwt.user.client.DOM.appendChild ( missing.getElement ( ) , li ) ; }
Source:
public void removeRow ( final int row ) { for ( final com.google.gerrit.client.changes.ChangeTable.Section s : sections ) { if ( row < ( s.titleRow ) ) { ( s.titleRow ) -- ; } if ( row < ( s.dataBegin ) ) { ( s.dataBegin ) -- ; } } super . removeRow ( row ) ; }

Target:
private void removeRow ( final int row ) { for ( final com.google.gerrit.client.changes.ChangeTable.Section s : sections ) { if ( row < ( s.titleRow ) ) { ( s.titleRow ) -- ; } if ( row < ( s.dataBegin ) ) { ( s.dataBegin ) -- ; } } table.removeRow ( row ) ; }
Source:
public void fire ( com.google.gerrit.reviewdb.client.Project.NameKey project , org.eclipse.jgit.lib.BatchRefUpdate batchRefUpdate , com.google.gerrit.reviewdb.client.Account.Id updater ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } for ( org.eclipse.jgit.transport.ReceiveCommand cmd : batchRefUpdate.getCommands ( ) ) { if ( ( cmd.getResult ( ) ) == ( ReceiveCommand.Result.OK ) ) { fire ( project , cmd , util.accountInfo ( updater ) ) ; } } }

Target:
public void fire ( com.google.gerrit.reviewdb.client.Project.NameKey project , org.eclipse.jgit.lib.BatchRefUpdate batchRefUpdate , com.google.gerrit.reviewdb.client.Account updater ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } for ( org.eclipse.jgit.transport.ReceiveCommand cmd : batchRefUpdate.getCommands ( ) ) { if ( ( cmd.getResult ( ) ) == ( ReceiveCommand.Result.OK ) ) { fire ( project , cmd , util.accountInfo ( updater ) ) ; } } }
Source:
public T call ( ) throws java.lang.Exception { final com.google.gerrit.server.CurrentUser user = context.getCurrentUser ( ) ; com.google.gerrit.server.util.RequestContext old = local.setContext ( new com.google.gerrit.server.util.RequestContext ( ) { @ java.lang.Override public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { return user ; } @ java.lang.Override public com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > getReviewDbProvider ( ) { return dbProviderProvider.get ( ) ; } } ) ; try { return callable.call ( ) ; } finally { local.setContext ( old ) ; } }

Target:
public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { return context.getCurrentUser ( ) ; }
Source:
void close ( ) { try { searcherManager.close ( ) ; } catch ( java.io.IOException e ) { com.google.gerrit.lucene.SubIndex.log.warn ( "error closing Lucene searcher" , e ) ; } try { writer.close ( true ) ; } catch ( java.io.IOException e ) { com.google.gerrit.lucene.SubIndex.log.warn ( "error closing Lucene writer" , e ) ; } try { dir.close ( ) ; } catch ( java.io.IOException e ) { com.google.gerrit.lucene.SubIndex.log.warn ( "error closing Lucene directory" , e ) ; } }

Target:
void close ( ) { try { searcherManager.close ( ) ; } catch ( java.io.IOException e ) { com.google.gerrit.lucene.SubIndex.log.warn ( "error closing Lucene searcher" , e ) ; } try { writer.close ( ) ; } catch ( java.io.IOException e ) { com.google.gerrit.lucene.SubIndex.log.warn ( "error closing Lucene writer" , e ) ; } try { dir.close ( ) ; } catch ( java.io.IOException e ) { com.google.gerrit.lucene.SubIndex.log.warn ( "error closing Lucene directory" , e ) ; } }
Source:
public void testSqlFriendlyNames ( ) { assertEquals ( "a" , com.google.gwtorm.schema.Util.makeSqlFriendly ( "a" ) ) ; assertEquals ( "url" , com.google.gwtorm.schema.Util.makeSqlFriendly ( "url" ) ) ; assertEquals ( "next_url" , com.google.gwtorm.schema.Util.makeSqlFriendly ( "nextUrl" ) ) ; assertEquals ( "next_url" , com.google.gwtorm.schema.Util.makeSqlFriendly ( "nextURL" ) ) ; assertEquals ( "urlnext" , com.google.gwtorm.schema.Util.makeSqlFriendly ( "URLnext" ) ) ; assertEquals ( "camel_case_name" , com.google.gwtorm.schema.Util.makeSqlFriendly ( "camelCaseName" ) ) ; }

Target:
public void testSqlFriendlyNames ( ) { org.junit.Assert.assertEquals ( "a" , com.google.gwtorm.schema.Util.makeSqlFriendly ( "a" ) ) ; org.junit.Assert.assertEquals ( "url" , com.google.gwtorm.schema.Util.makeSqlFriendly ( "url" ) ) ; org.junit.Assert.assertEquals ( "next_url" , com.google.gwtorm.schema.Util.makeSqlFriendly ( "nextUrl" ) ) ; org.junit.Assert.assertEquals ( "next_url" , com.google.gwtorm.schema.Util.makeSqlFriendly ( "nextURL" ) ) ; org.junit.Assert.assertEquals ( "urlnext" , com.google.gwtorm.schema.Util.makeSqlFriendly ( "URLnext" ) ) ; org.junit.Assert.assertEquals ( "camel_case_name" , com.google.gwtorm.schema.Util.makeSqlFriendly ( "camelCaseName" ) ) ; }
Source:
protected void configure ( ) { install ( new com.google.gerrit.server.schema.SchemaVersion.Module ( ) ) ; bind ( org.eclipse.jgit.lib.PersonIdent.class ) . annotatedWith ( com.google.gerrit.server.GerritPersonIdent.class ) . toProvider ( com.google.gerrit.server.GerritPersonIdentProvider.class ) ; bind ( com.google.gerrit.server.config.AllProjectsName.class ) . toProvider ( com.google.gerrit.server.config.AllProjectsNameProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( com.google.gerrit.server.git.GitRepositoryManager.class ) . to ( com.google.gerrit.server.git.LocalDiskRepositoryManager.class ) ; install ( new com.google.gerrit.lifecycle.LifecycleModule ( ) { @ java.lang.Override protected void configure ( ) { listener ( ) . to ( LocalDiskRepositoryManager.Lifecycle.class ) ; } } ) ; }

Target:
protected void configure ( ) { install ( new com.google.gerrit.server.schema.SchemaVersion.Module ( ) ) ; bind ( org.eclipse.jgit.lib.PersonIdent.class ) . annotatedWith ( com.google.gerrit.server.GerritPersonIdent.class ) . toProvider ( com.google.gerrit.server.GerritPersonIdentProvider.class ) ; bind ( com.google.gerrit.server.config.AllProjectsName.class ) . toProvider ( com.google.gerrit.server.config.AllProjectsNameProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; }
Source:
public void add ( com.google.gerrit.extensions.registration.RegistrationHandle handle ) { if ( ( serverManager ) != null ) { if ( handle instanceof com.google.gerrit.extensions.registration.ReloadableRegistrationHandle ) { if ( ( reloadableHandles ) == null ) { reloadableHandles = com.google.common.collect.Lists.newArrayList ( ) ; } reloadableHandles.add ( ( ( com.google.gerrit.extensions.registration.ReloadableRegistrationHandle < ? > ) ( handle ) ) ) ; } serverManager.add ( handle ) ; } }

Target:
public void add ( com.google.gerrit.extensions.registration.RegistrationHandle handle ) { if ( ( serverManager ) != null ) { if ( handle instanceof com.google.gerrit.extensions.registration.ReloadableRegistrationHandle ) { if ( ( reloadableHandles ) == null ) { reloadableHandles = new java.util.ArrayList < > ( ) ; } reloadableHandles.add ( ( ( com.google.gerrit.extensions.registration.ReloadableRegistrationHandle < ? > ) ( handle ) ) ) ; } serverManager.add ( handle ) ; } }
Source:
public void deleteBranches ( ) throws java.lang.Exception { java.util.HashMap < java.lang.String , org.eclipse.jgit.revwalk.RevCommit > initialRevisions = initialRevisions ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; com.google.gerrit.extensions.api.projects.DeleteBranchesInput input = new com.google.gerrit.extensions.api.projects.DeleteBranchesInput ( ) ; input.branches = com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ; project ( ) . deleteBranches ( input ) ; assertBranchesDeleted ( ) ; assertRefUpdatedEvents ( initialRevisions ) ; }

Target:
public void deleteBranches ( ) throws java.lang.Exception { java.util.HashMap < java.lang.String , org.eclipse.jgit.revwalk.RevCommit > initialRevisions = initialRevisions ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; com.google.gerrit.extensions.api.projects.DeleteBranchesInput input = new com.google.gerrit.extensions.api.projects.DeleteBranchesInput ( ) ; input.branches = com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ; project ( ) . deleteBranches ( input ) ; assertBranchesDeleted ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; assertRefUpdatedEvents ( initialRevisions ) ; }
Source:
private java.util.Map < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.reviewdb.client.Change.Id > openChangesByKey ( com.google.gerrit.reviewdb.client.Branch.NameKey branch ) throws com.google.gwtorm.server.OrmException { final java.util.Map < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.reviewdb.client.Change.Id > r = new java.util.HashMap < > ( ) ; for ( com.google.gerrit.reviewdb.client.Change c : db.changes ( ) . byBranchOpenAll ( branch ) ) { r.put ( c.getKey ( ) , c.getId ( ) ) ; } return r ; }

Target:
private java.util.Map < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.reviewdb.client.Change > openChangesByKey ( com.google.gerrit.reviewdb.client.Branch.NameKey branch ) throws com.google.gwtorm.server.OrmException { final java.util.Map < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.reviewdb.client.Change > r = new java.util.HashMap < > ( ) ; for ( com.google.gerrit.reviewdb.client.Change c : db.changes ( ) . byBranchOpenAll ( branch ) ) { r.put ( c.getKey ( ) , c ) ; } return r ; }
Source:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo restorer , java.lang.String reason , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.ChangeRestored.Event event = new com.google.gerrit.server.extensions.events.ChangeRestored.Event ( change , revision , restorer , reason , when ) ; for ( com.google.gerrit.extensions.events.ChangeRestoredListener l : listeners ) { try { l.onChangeRestored ( event ) ; } catch ( java.lang.Exception e ) { util.logEventListenerError ( com.google.gerrit.server.extensions.events.ChangeRestored.log , e ) ; } } }

Target:
private void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo restorer , java.lang.String reason , java.sql.Timestamp when ) { com.google.gerrit.server.extensions.events.ChangeRestored.Event event = new com.google.gerrit.server.extensions.events.ChangeRestored.Event ( change , revision , restorer , reason , when ) ; for ( com.google.gerrit.extensions.events.ChangeRestoredListener l : listeners ) { try { l.onChangeRestored ( event ) ; } catch ( java.lang.Exception e ) { util.logEventListenerError ( com.google.gerrit.server.extensions.events.ChangeRestored.log , e ) ; } } }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.change.ChangeKindCache.class ) . to ( com.google.gerrit.server.change.ChangeKindCacheImpl.class ) ; persist ( com.google.gerrit.server.change.ChangeKindCacheImpl.ID_CACHE , com.google.gerrit.server.change.ChangeKindCacheImpl.Key.class , com.google.gerrit.server.change.ChangeKind.class ) . maximumWeight ( ( 2 << 20 ) ) . weigher ( com.google.gerrit.server.change.ChangeKindCacheImpl.ChangeKindWeigher.class ) . loader ( com.google.gerrit.server.change.ChangeKindCacheImpl.Loader.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.change.ChangeKindCache.class ) . to ( com.google.gerrit.server.change.ChangeKindCacheImpl.class ) ; persist ( com.google.gerrit.server.change.ChangeKindCacheImpl.ID_CACHE , com.google.gerrit.server.change.ChangeKindCacheImpl.Key.class , com.google.gerrit.server.change.ChangeKind.class ) . maximumWeight ( ( 2 << 20 ) ) . weigher ( com.google.gerrit.server.change.ChangeKindCacheImpl.ChangeKindWeigher.class ) ; }
Source:
private boolean isFile ( ) { boolean isCommitMessage = Patch.COMMIT_MSG.equals ( script.getNewName ( ) ) ; return ! ( ( isCommitMessage || ( ( ( side ) == ( com.google.gerrit.client.patches.PatchSetSelectBox.Side.A ) ) && ( 0 >= ( script.getA ( ) . size ( ) ) ) ) ) || ( ( ( side ) == ( com.google.gerrit.client.patches.PatchSetSelectBox.Side.B ) ) && ( 0 >= ( script.getB ( ) . size ( ) ) ) ) ) ; }

Target:
public boolean isFile ( ) { boolean isCommitMessage = Patch.COMMIT_MSG.equals ( script.getNewName ( ) ) ; return ! ( ( isCommitMessage || ( ( ( side ) == ( com.google.gerrit.client.patches.PatchSetSelectBox.Side.A ) ) && ( 0 >= ( script.getA ( ) . size ( ) ) ) ) ) || ( ( ( side ) == ( com.google.gerrit.client.patches.PatchSetSelectBox.Side.B ) ) && ( 0 >= ( script.getB ( ) . size ( ) ) ) ) ) ; }
Source:
protected void add ( final com.google.gwtorm.schema.RelationModel r ) throws com.google.gwtorm.client.OrmException { final java.lang.String n = r.getRelationName ( ) ; checkNotUsed ( n ) ; if ( ( relations.put ( n , r ) ) != null ) { throw new com.google.gwtorm.client.OrmException ( ( "Duplicate relations " + n ) ) ; } allNames.add ( n ) ; }

Target:
protected void add ( final com.google.gwtorm.schema.RelationModel r ) throws com.google.gwtorm.server.OrmException { final java.lang.String n = r.getRelationName ( ) ; checkNotUsed ( n ) ; if ( ( relations.put ( n , r ) ) != null ) { throw new com.google.gwtorm.server.OrmException ( ( "Duplicate relations " + n ) ) ; } allNames.add ( n ) ; }
Source:
public boolean equals ( final java.lang.Object other ) { if ( ( getClass ( ) ) == ( other.getClass ( ) ) ) { final com.google.gerrit.server.query.WildPatternPredicate < ? > p = ( ( com.google.gerrit.server.query.WildPatternPredicate < ? > ) ( other ) ) ; return com.google.gerrit.server.query.WildPatternPredicate.getOperator ( ) . equals ( p.getOperator ( ) ) ; } return false ; }

Target:
public boolean equals ( final java.lang.Object other ) { if ( other == null ) return false ; if ( ( getClass ( ) ) == ( other.getClass ( ) ) ) { final com.google.gerrit.server.query.WildPatternPredicate < ? > p = ( ( com.google.gerrit.server.query.WildPatternPredicate < ? > ) ( other ) ) ; return com.google.gerrit.server.query.WildPatternPredicate.getOperator ( ) . equals ( p.getOperator ( ) ) ; } return false ; }
Source:
public void testRejectJavaScript_ImgSrc ( ) { final java.lang.String href = "javascript:window.close();" ; try { new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . openElement ( "img" ) . setAttribute ( "src" , href ) ; fail ( "accepted javascript in img src" ) ; } catch ( java.lang.RuntimeException e ) { assertEquals ( ( "javascript unsafe in href: " + href ) , e.getMessage ( ) ) ; } }

Target:
public void testRejectJavaScript_ImgSrc ( ) { final java.lang.String href = "javascript:window.close();" ; try { new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . openElement ( "img" ) . setAttribute ( "src" , href ) ; org.junit.Assert.fail ( "accepted javascript in img src" ) ; } catch ( java.lang.RuntimeException e ) { org.junit.Assert.assertEquals ( ( "javascript unsafe in href: " + href ) , e.getMessage ( ) ) ; } }
Source:
private com.google.gitiles.GitilesView getView ( java.lang.String pathAndQuery ) throws java.io.IOException , javax.servlet.ServletException { java.util.concurrent.atomic.AtomicReference < com.google.gitiles.GitilesView > view = com.google.common.util.concurrent.Atomics.newReference ( ) ; com.google.gitiles.FakeHttpServletResponse res = new com.google.gitiles.FakeHttpServletResponse ( ) ; service ( pathAndQuery , view , res ) ; assertTrue ( ( "expected non-redirect status, got " + ( res.getStatus ( ) ) ) , ( ( ( res.getStatus ( ) ) < 300 ) || ( ( res.getStatus ( ) ) >= 400 ) ) ) ; return view.get ( ) ; }

Target:
private com.google.gitiles.GitilesView getView ( java.lang.String pathAndQuery ) throws java.io.IOException , javax.servlet.ServletException { java.util.concurrent.atomic.AtomicReference < com.google.gitiles.GitilesView > view = com.google.common.util.concurrent.Atomics.newReference ( ) ; com.google.gitiles.FakeHttpServletResponse res = new com.google.gitiles.FakeHttpServletResponse ( ) ; service ( pathAndQuery , view , res ) ; org.junit.Assert.assertTrue ( ( "expected non-redirect status, got " + ( res.getStatus ( ) ) ) , ( ( ( res.getStatus ( ) ) < 300 ) || ( ( res.getStatus ( ) ) >= 400 ) ) ) ; return view.get ( ) ; }
Source:
public com.google.common.base.Optional < com.google.gerrit.reviewdb.client.Account.Id > load ( java.lang.String username ) throws java.lang.Exception { final com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ; try { final com.google.gerrit.reviewdb.client.AccountExternalId.Key key = new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_USERNAME , username ) ; final com.google.gerrit.reviewdb.client.AccountExternalId id = db.accountExternalIds ( ) . get ( key ) ; if ( id != null ) { return com.google.common.base.Optional.of ( id.getAccountId ( ) ) ; } return com.google.common.base.Optional.absent ( ) ; } finally { db.close ( ) ; } }

Target:
public com.google.common.base.Optional < com.google.gerrit.reviewdb.client.Account.Id > load ( java.lang.String username ) throws java.lang.Exception { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { final com.google.gerrit.reviewdb.client.AccountExternalId.Key key = new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_USERNAME , username ) ; final com.google.gerrit.reviewdb.client.AccountExternalId id = db.accountExternalIds ( ) . get ( key ) ; if ( id != null ) { return com.google.common.base.Optional.of ( id.getAccountId ( ) ) ; } return com.google.common.base.Optional.absent ( ) ; } }
Source:
public void namedAnchor ( ) throws java.lang.Exception { java.lang.String markdown = "# Section {#debug}\n" + "# Other <a name=\"old-school\"></a>\n" ; repo.branch ( "master" ) . commit ( ) . add ( "index.md" , markdown ) . create ( ) ; java.lang.String html = buildHtml ( "/repo/+doc/master/" ) ; org.junit.Assert.assertTrue ( html.contains ( ( "<h1>" + ( "<a class=\"h\" name=\"debug\" href=\"#debug\"><span></span></a>" + "Section</h1>" ) ) ) ) ; org.junit.Assert.assertTrue ( html.contains ( ( "<h1>" + ( "<a class=\"h\" name=\"old-school\" href=\"#old-school\"><span></span></a>" + "Other</h1>" ) ) ) ) ; }

Target:
public void namedAnchor ( ) throws java.lang.Exception { java.lang.String markdown = "# Section {#debug}\n" + "# Other <a name=\"old-school\"></a>\n" ; repo.branch ( "master" ) . commit ( ) . add ( "index.md" , markdown ) . create ( ) ; java.lang.String html = buildHtml ( "/repo/+doc/master/" ) ; com.google.common.truth.Truth.assertThat ( html ) . contains ( ( "<h1>" + ( "<a class=\"h\" name=\"debug\" href=\"#debug\"><span></span></a>" + "Section</h1>" ) ) ) ; com.google.common.truth.Truth.assertThat ( html ) . contains ( ( "<h1>" + ( "<a class=\"h\" name=\"old-school\" href=\"#old-school\"><span></span></a>" + "Other</h1>" ) ) ) ; }
Source:
public java.lang.String formatValue ( ) { if ( ( getValue ( ) ) < 0 ) { return java.lang.Short.toString ( getValue ( ) ) ; } else if ( ( getValue ( ) ) == 0 ) { return " 0" ; } else { return "+" + ( java.lang.Short.toString ( getValue ( ) ) ) ; } }

Target:
public static java.lang.String formatValue ( short value ) { if ( value < 0 ) { return java.lang.Short.toString ( value ) ; } else if ( value == 0 ) { return " 0" ; } else { return "+" + ( java.lang.Short.toString ( value ) ) ; } }
Source:
public void testCreate_NotDirectory ( ) throws java.io.IOException { final java.io.File root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; try { assertTrue ( root.createNewFile ( ) ) ; try { new com.google.gerrit.server.config.SitePaths ( root ) ; fail ( "Did not throw exception" ) ; } catch ( java.io.FileNotFoundException e ) { assertEquals ( ( "Not a directory: " + ( root.getPath ( ) ) ) , e.getMessage ( ) ) ; } } finally { root.delete ( ) ; } }

Target:
public void testCreate_NotDirectory ( ) throws java.io.IOException { final java.io.File root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; try { org.junit.Assert.assertTrue ( root.createNewFile ( ) ) ; try { new com.google.gerrit.server.config.SitePaths ( root ) ; org.junit.Assert.fail ( "Did not throw exception" ) ; } catch ( java.io.FileNotFoundException e ) { org.junit.Assert.assertEquals ( ( "Not a directory: " + ( root.getPath ( ) ) ) , e.getMessage ( ) ) ; } } finally { root.delete ( ) ; } }
Source:
javax.servlet.http.HttpServlet getFaviconServlet ( @ com.google.inject.name.Named ( value = com.google.gerrit.httpd.raw.StaticModule.CACHE ) com.google.common.cache.Cache < java.nio.file.Path , com.google.gerrit.httpd.raw.ResourceServlet.Resource > cache ) { com.google.gerrit.httpd.raw.StaticModule.Paths p = getPaths ( ) ; if ( ( p.warFs ) != null ) { return new com.google.gerrit.httpd.raw.SingleFileServlet ( cache , p.warFs.getPath ( "/favicon.ico" ) , false ) ; } else { return new com.google.gerrit.httpd.raw.SingleFileServlet ( cache , webappSourcePath ( "favicon.ico" ) , true ) ; } }

Target:
javax.servlet.http.HttpServlet getFaviconServlet ( @ com.google.inject.name.Named ( value = com.google.gerrit.httpd.raw.StaticModule.CACHE ) com.google.common.cache.Cache < java.nio.file.Path , com.google.gerrit.httpd.raw.ResourceServlet.Resource > cache ) { com.google.gerrit.httpd.raw.StaticModule.Paths p = getPaths ( ) ; if ( ( p.warFs ) != null ) { return new com.google.gerrit.httpd.raw.SingleFileServlet ( cache , p.warFs.getPath ( "/favicon.ico" ) , false ) ; } return new com.google.gerrit.httpd.raw.SingleFileServlet ( cache , webappSourcePath ( "favicon.ico" ) , true ) ; }
Source:
public void afterRefUpdates ( ) throws com.google.gerrit.extensions.restapi.ResourceConflictException { if ( failAfterRefUpdates ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "Failing after ref updates" ) ; } for ( com.google.gerrit.server.git.strategy.SubmitStrategy strategy : strategies ) { com.google.gerrit.server.git.strategy.SubmitStrategy.Arguments args = strategy.args ; if ( args.mergeTip.getCurrentTip ( ) . equals ( args.mergeTip.getInitialTip ( ) ) ) { continue ; } com.google.gerrit.reviewdb.client.Account account = args.accountCache.get ( args.caller.getAccountId ( ) ) . getAccount ( ) ; args.hooks.doRefUpdatedHook ( args.destBranch , args.mergeTip.getInitialTip ( ) , args.mergeTip.getCurrentTip ( ) , account ) ; } }

Target:
public void afterRefUpdates ( ) throws com.google.gerrit.extensions.restapi.ResourceConflictException { if ( failAfterRefUpdates ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "Failing after ref updates" ) ; } for ( com.google.gerrit.server.git.strategy.SubmitStrategy strategy : strategies ) { com.google.gerrit.server.git.strategy.SubmitStrategy.Arguments args = strategy.args ; if ( args.mergeTip.getCurrentTip ( ) . equals ( args.mergeTip.getInitialTip ( ) ) ) { continue ; } } }
Source:
public com.google.gerrit.server.change.ConsistencyChecker.Result check ( com.google.gerrit.reviewdb.client.Change c , @ com.google.gerrit.common.Nullable com.google.gerrit.extensions.api.changes.FixInput f ) { reset ( ) ; fix = f ; change = c ; try { checkImpl ( ) ; return com.google.gerrit.server.change.ConsistencyChecker.Result.create ( c , problems ) ; } finally { if ( ( rw ) != null ) { rw.release ( ) ; } if ( ( repo ) != null ) { repo.close ( ) ; } } }

Target:
public com.google.gerrit.server.change.ConsistencyChecker.Result check ( com.google.gerrit.reviewdb.client.Change c , @ com.google.gerrit.common.Nullable com.google.gerrit.extensions.api.changes.FixInput f ) { reset ( ) ; fix = f ; change = c ; try { checkImpl ( ) ; return com.google.gerrit.server.change.ConsistencyChecker.Result.create ( c , problems ) ; } finally { if ( ( rw ) != null ) { rw.close ( ) ; } if ( ( repo ) != null ) { repo.close ( ) ; } } }
Source:
private int insert ( final java.util.List < com.google.gerrit.client.reviewdb.PatchLineComment > in , int row ) { for ( java.util.Iterator < com.google.gerrit.client.reviewdb.PatchLineComment > ci = in.iterator ( ) ; ci.hasNext ( ) ; ) { final com.google.gerrit.client.reviewdb.PatchLineComment c = ci.next ( ) ; table.insertRow ( row ) ; table.getCellFormatter ( ) . setStyleName ( row , 0 , com.google.gerrit.client.patches.S_ICON_CELL ) ; bindComment ( row , com.google.gerrit.client.patches.UnifiedDiffTable.PC , c , ( ! ( ci.hasNext ( ) ) ) ) ; row ++ ; } return row ; }

Target:
private int insert ( final java.util.List < com.google.gerrit.client.reviewdb.PatchLineComment > in , int row ) { for ( java.util.Iterator < com.google.gerrit.client.reviewdb.PatchLineComment > ci = in.iterator ( ) ; ci.hasNext ( ) ; ) { final com.google.gerrit.client.reviewdb.PatchLineComment c = ci.next ( ) ; insertRow ( row ) ; bindComment ( row , com.google.gerrit.client.patches.UnifiedDiffTable.PC , c , ( ! ( ci.hasNext ( ) ) ) ) ; row ++ ; } return row ; }
Source:
com.ericsson.gerrit.plugins.eventslog.sql.SQLClient provideLocalSqlClient ( com.ericsson.gerrit.plugins.eventslog.EventsLogConfig cfg ) { java.lang.String path = cfg.getLocalStorePath ( ) . toString ( ) ; path = ( path.endsWith ( "/" ) ) ? path : path + "/" ; return new com.ericsson.gerrit.plugins.eventslog.sql.SQLClient ( cfg.getLocalStoreDriver ( ) , ( ( com.ericsson.gerrit.plugins.eventslog.sql.SQLModule.H2_DB_PREFIX ) + path ) , cfg.getUrlOptions ( ) ) ; }

Target:
com.ericsson.gerrit.plugins.eventslog.sql.SQLClient provideLocalSqlClient ( com.ericsson.gerrit.plugins.eventslog.EventsLogConfig cfg ) { return new com.ericsson.gerrit.plugins.eventslog.sql.SQLClient ( cfg.getLocalStoreDriver ( ) , ( ( ( com.ericsson.gerrit.plugins.eventslog.sql.SQLModule.H2_DB_PREFIX ) + ( cfg.getLocalStorePath ( ) ) ) + "/" ) , cfg.getUrlOptions ( ) ) ; }
Source:
private void openLine ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , boolean isForTableHeader ) { m.openTr ( ) ; m.openTd ( ) ; m.setStyleName ( Gerrit.RESOURCES.css ( ) . iconCell ( ) ) ; if ( isForTableHeader ) { m.addStyleName ( Gerrit.RESOURCES.css ( ) . fileColumnHeader ( ) ) ; } else { m.setAttribute ( "valign" , "top" ) ; } m.closeTd ( ) ; }

Target:
private void openLine ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m ) { m.openTr ( ) ; m.setAttribute ( "valign" , "top" ) ; m.openTd ( ) ; m.setStyleName ( Gerrit.RESOURCES.css ( ) . iconCell ( ) ) ; m.closeTd ( ) ; }
Source:
public java.util.List < com.google.gerrit.server.query.change.ChangeData > bySubmissionId ( java.lang.String cs ) throws com.google.gwtorm.server.OrmException { if ( ( com.google.common.base.Strings.isNullOrEmpty ( cs ) ) || ( ! ( com.google.gerrit.server.query.change.InternalChangeQuery.schema ( indexes ) . hasField ( com.google.gerrit.server.index.change.ChangeField.SUBMISSIONID ) ) ) ) { return java.util.Collections.emptyList ( ) ; } else { return query ( new com.google.gerrit.server.query.change.SubmissionIdPredicate ( cs ) ) ; } }

Target:
public java.util.List < com.google.gerrit.server.query.change.ChangeData > bySubmissionId ( java.lang.String cs ) throws com.google.gwtorm.server.OrmException { if ( ( com.google.common.base.Strings.isNullOrEmpty ( cs ) ) || ( ! ( com.google.gerrit.server.query.change.InternalChangeQuery.schema ( indexes ) . hasField ( com.google.gerrit.server.index.change.ChangeField.SUBMISSIONID ) ) ) ) { return java.util.Collections.emptyList ( ) ; } return query ( new com.google.gerrit.server.query.change.SubmissionIdPredicate ( cs ) ) ; }
Source:
private static org.eclipse.jgit.dircache.DirCacheEditor.PathEdit getPathEdit ( com.google.gerrit.server.edit.ChangeEditModifier.TreeOperation op , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.revwalk.RevCommit base , java.lang.String path , org.eclipse.jgit.lib.ObjectInserter ins , byte [ ] content ) throws com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { final org.eclipse.jgit.lib.ObjectId oid = ( op == ( com.google.gerrit.server.edit.ChangeEditModifier.TreeOperation.CHANGE_ENTRY ) ) ? ins.insert ( Constants.OBJ_BLOB , content ) : com.google.gerrit.server.edit.ChangeEditModifier.getObjectIdForRestoreOperation ( repo , rw , base , path ) ; return new org.eclipse.jgit.dircache.DirCacheEditor.PathEdit ( path ) { @ java.lang.Override public void apply ( org.eclipse.jgit.dircache.DirCacheEntry ent ) { ent.setFileMode ( FileMode.REGULAR_FILE ) ; ent.setObjectId ( oid ) ; } } ; }

Target:
private static org.eclipse.jgit.dircache.DirCacheEditor.PathEdit getPathEdit ( com.google.gerrit.server.edit.ChangeEditModifier.TreeOperation op , org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.revwalk.RevCommit base , java.lang.String path , org.eclipse.jgit.lib.ObjectInserter ins , byte [ ] content ) throws com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { final org.eclipse.jgit.lib.ObjectId oid = ( op == ( com.google.gerrit.server.edit.ChangeEditModifier.TreeOperation.CHANGE_ENTRY ) ) ? ins.insert ( Constants.OBJ_BLOB , content ) : com.google.gerrit.server.edit.ChangeEditModifier.getObjectIdForRestoreOperation ( rw , base , path ) ; return new org.eclipse.jgit.dircache.DirCacheEditor.PathEdit ( path ) { @ java.lang.Override public void apply ( org.eclipse.jgit.dircache.DirCacheEntry ent ) { ent.setFileMode ( FileMode.REGULAR_FILE ) ; ent.setObjectId ( oid ) ; } } ; }
Source:
private com.google.gerrit.acceptance.server.mail.StagedChange stageChange ( com.google.gerrit.acceptance.server.mail.DeleteVoteSenderIT.Stager stager ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stager.stage ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; setApiUser ( voter ) ; gApi.changes ( ) . id ( sc.changeId ) . revision ( "current" ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.recommend ( ) ) ; return sc ; }

Target:
private com.google.gerrit.acceptance.server.mail.StagedChange stageChange ( com.google.gerrit.acceptance.server.mail.DeleteVoteSenderIT.Stager stager ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stager.stage ( ) ; setApiUser ( voter ) ; gApi.changes ( ) . id ( sc.changeId ) . revision ( "current" ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.recommend ( ) ) ; return sc ; }
Source:
private com.google.gerrit.server.notedb.NoteDbUpdateManager.OpenRepo openRepo ( com.google.gerrit.reviewdb.client.Project.NameKey p ) throws java.io.IOException { org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( p ) ; org.eclipse.jgit.lib.ObjectInserter ins = repo.newObjectInserter ( ) ; return new com.google.gerrit.server.notedb.NoteDbUpdateManager.OpenRepo ( repo , new org.eclipse.jgit.revwalk.RevWalk ( ins.newReader ( ) ) , ins , new com.google.gerrit.server.git.ChainedReceiveCommands ( ) , true ) ; }

Target:
private com.google.gerrit.server.notedb.NoteDbUpdateManager.OpenRepo openRepo ( com.google.gerrit.reviewdb.client.Project.NameKey p ) throws java.io.IOException { org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( p ) ; org.eclipse.jgit.lib.ObjectInserter ins = repo.newObjectInserter ( ) ; return new com.google.gerrit.server.notedb.NoteDbUpdateManager.OpenRepo ( repo , new org.eclipse.jgit.revwalk.RevWalk ( ins.newReader ( ) ) , ins , new com.google.gerrit.server.git.ChainedReceiveCommands ( repo ) , true ) ; }
Source:
public void testCreate_NotExisting ( ) throws java.io.IOException { final java.nio.file.Path root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; org.junit.Assert.assertTrue ( site.isNew ) ; org.junit.Assert.assertEquals ( root.toFile ( ) , site.site_path ) ; org.junit.Assert.assertEquals ( root.resolve ( "etc" ) , site.etc_dir ) ; }

Target:
public void testCreate_NotExisting ( ) throws java.io.IOException { final java.nio.file.Path root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; org.junit.Assert.assertTrue ( site.isNew ) ; org.junit.Assert.assertEquals ( root , site.site_path ) ; org.junit.Assert.assertEquals ( root.resolve ( "etc" ) , site.etc_dir ) ; }
Source:
public < V > void newConstantMetric ( java.lang.String name , V value , com.google.gerrit.metrics.Description desc ) { desc.setConstant ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.lang.Class < V > type = ( ( java.lang.Class < V > ) ( value.getClass ( ) ) ) ; com.google.gerrit.metrics.CallbackMetric0 < V > metric = newCallbackMetric ( name , type , desc ) ; newTrigger ( metric , ( ) -> { metric.set ( value ) ; } ) ; }

Target:
public < V > void newConstantMetric ( java.lang.String name , V value , com.google.gerrit.metrics.Description desc ) { desc.setConstant ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.lang.Class < V > type = ( ( java.lang.Class < V > ) ( value.getClass ( ) ) ) ; com.google.gerrit.metrics.CallbackMetric0 < V > metric = newCallbackMetric ( name , type , desc ) ; newTrigger ( metric , ( ) -> metric.set ( value ) ) ; }
Source:
public void writeTo ( java.io.OutputStream out ) throws java.io.IOException { java.io.OutputStream e = com.google.common.io.BaseEncoding.base64 ( ) . encodingStream ( new java.io.OutputStreamWriter ( out , java.nio.charset.StandardCharsets.ISO_8859_1 ) ) ; src.writeTo ( e ) ; e.flush ( ) ; }

Target:
public void writeTo ( java.io.OutputStream out ) throws java.io.IOException { try ( java.io.OutputStreamWriter w = new java.io.OutputStreamWriter ( out , java.nio.charset.StandardCharsets.ISO_8859_1 ) ; java.io.OutputStream e = com.google.common.io.BaseEncoding.base64 ( ) . encodingStream ( w ) ) { src.writeTo ( e ) ; e.flush ( ) ; } }
Source:
protected boolean onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { if ( super . onKeyPress ( event ) ) { return true ; } if ( ! ( event.isAnyModifierKeyDown ( ) ) ) { switch ( event.getCharCode ( ) ) { case 's' : onStarClick ( getCurrentRow ( ) ) ; return true ; } } return false ; }

Target:
public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { onStarClick ( getCurrentRow ( ) ) ; }
Source:
protected void configure ( ) { bind ( java.io.File.class ) . annotatedWith ( com.google.gerrit.server.config.SitePath.class ) . toInstance ( sitePath ) ; bind ( DataSourceProvider.Context.class ) . toInstance ( DataSourceProvider.Context.MULTI_USER ) ; bind ( com.google.inject.Key.get ( javax.sql.DataSource.class , com.google.inject.name.Names.named ( "ReviewDb" ) ) ) . toProvider ( com.google.gerrit.server.schema.DataSourceProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; listener ( ) . to ( com.google.gerrit.server.schema.DataSourceProvider.class ) ; }

Target:
protected void configure ( ) { bind ( DataSourceProvider.Context.class ) . toInstance ( DataSourceProvider.Context.MULTI_USER ) ; bind ( com.google.inject.Key.get ( javax.sql.DataSource.class , com.google.inject.name.Names.named ( "ReviewDb" ) ) ) . toProvider ( com.google.gerrit.server.schema.DataSourceProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; listener ( ) . to ( com.google.gerrit.server.schema.DataSourceProvider.class ) ; }