auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
com.google.gerrit.server.account.externalids.ExternalId get ( com.google.gerrit.server.account.externalids.ExternalId.Key key ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { checkReadEnabled ( ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsersName ) ; org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { org.eclipse.jgit.lib.ObjectId rev = com.google.gerrit.server.account.externalids.ExternalIdReader.readRevision ( repo ) ; if ( rev.equals ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) ) ) { return null ; } return com.google.gerrit.server.account.externalids.ExternalIdReader.parse ( key , rw , rev ) ; } }

Target:
java.util.Set < com.google.gerrit.server.account.externalids.ExternalId > all ( org.eclipse.jgit.lib.ObjectId rev ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { checkReadEnabled ( ) ; try ( com.google.gerrit.metrics.Timer0.Context ctx = readAllLatency.start ( ) ; org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsersName ) ) { return com.google.gerrit.server.account.externalids.ExternalIdNotes.loadReadOnly ( repo , rev ) . all ( ) ; } }
Source:
private void testpushWithInvalidChangeId ( ) throws java.lang.Exception { com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , ( "Message with invalid Change-Id\n" + ( "\n" + "Change-Id: X\n" ) ) ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; com.google.gerrit.server.git.ProjectConfig config = projectCache.checkedGet ( project ) . getConfig ( ) ; config.getProject ( ) . setRequireChangeID ( InheritableBoolean.FALSE ) ; saveProjectConfig ( project , config ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; }

Target:
private void testpushWithInvalidChangeId ( ) throws java.lang.Exception { com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , "Message with invalid Change-Id\n\nChange-Id: X\n" ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; com.google.gerrit.server.git.ProjectConfig config = projectCache.checkedGet ( project ) . getConfig ( ) ; config.getProject ( ) . setRequireChangeID ( InheritableBoolean.FALSE ) ; saveProjectConfig ( project , config ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; }
Source:
public void initConfig ( com.google.gerrit.pgm.init.Section databaseSection ) { final java.lang.String defPort = "(mysql default)" ; databaseSection.string ( "Server hostname" , "hostname" , "localhost" ) ; databaseSection.string ( "Server port" , "port" , defPort , true ) ; databaseSection.string ( "Database name" , "database" , "reviewdb" ) ; databaseSection.string ( "Database username" , "username" , com.google.gerrit.pgm.init.InitUtil.username ( ) ) ; databaseSection.password ( "username" , "password" ) ; }

Target:
public void initConfig ( com.google.gerrit.pgm.init.api.Section databaseSection ) { final java.lang.String defPort = "(mysql default)" ; databaseSection.string ( "Server hostname" , "hostname" , "localhost" ) ; databaseSection.string ( "Server port" , "port" , defPort , true ) ; databaseSection.string ( "Database name" , "database" , "reviewdb" ) ; databaseSection.string ( "Database username" , "username" , com.google.gerrit.pgm.init.InitUtil.username ( ) ) ; databaseSection.password ( "username" , "password" ) ; }
Source:
public void description ( java.lang.String description ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.change.PutDescription.Input in = new com.google.gerrit.server.change.PutDescription.Input ( ) ; in.description = description ; try { putDescription.apply ( revision , in ) ; } catch ( com.google.gerrit.server.update.UpdateException | com.google.gerrit.server.permissions.PermissionBackendException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot set description" , e ) ; } }

Target:
public void description ( java.lang.String description ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.change.PutDescription.Input in = new com.google.gerrit.server.change.PutDescription.Input ( ) ; in.description = description ; try { putDescription.apply ( revision , in ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot set description" , e ) ; } }
Source:
public void testChildren ( ) { 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.assertEquals ( 1 , n.getChildCount ( ) ) ; org.junit.Assert.assertSame ( p , n.getChild ( 0 ) ) ; }

Target:
public void testChildren ( ) { final com.google.gerrit.server.query.TestPredicate p = 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.assertEquals ( 1 , n.getChildCount ( ) ) ; org.junit.Assert.assertSame ( p , n.getChild ( 0 ) ) ; }
Source:
public void testMissingDownstreamMerges_custom ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result result = createChange ( "subject" , "filename" , "content" , "testtopic" ) ; pushConfig ( "alternate.config" , result.getChange ( ) . project ( ) . get ( ) ) ; result.assertOkStatus ( ) ; int changeNumber = result.getChange ( ) . getId ( ) . id ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceConflictException.class ) ; exception.expectMessage ( ( ( "Failed to submit 1 change due to the following problems:\nChange " + changeNumber ) + ": there is no ds_one" ) ) ; merge ( result ) ; }

Target:
public void testNoMissingDownstreamMerges_branchWithBraces ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result result = createChange ( "subject" , "filename" , "content" , "testtopic" ) ; java.lang.String projectName = result.getChange ( ) . change ( ) . getProject ( ) . get ( ) ; createBranch ( new com.google.gerrit.reviewdb.client.Branch.NameKey ( projectName , "branch{}braces" ) ) ; pushConfig ( "automerger.config" , projectName , "branch{}braces" ) ; amendChange ( result.getChangeId ( ) ) ; result.assertOkStatus ( ) ; merge ( result ) ; }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > patchSetDrafts ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByPatchSetAuthor ( ctx.getDb ( ) , psId , user.getAccountId ( ) , ctx.getNotes ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }

Target:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > patchSetDrafts ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = new java.util.HashMap < > ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByPatchSetAuthor ( ctx.getDb ( ) , psId , user.getAccountId ( ) , ctx.getNotes ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }
Source:
public void testSubscriptionDeepRelative ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < ? > superRepo = createProjectWithPush ( "super-project" ) ; org.eclipse.jgit.junit.TestRepository < ? > subRepo = createProjectWithPush ( "nested/subscribed-to-project" ) ; allowSubmoduleSubscription ( "nested/subscribed-to-project" , "refs/heads/master" , "super-project" , null ) ; pushChangeTo ( subRepo , "master" ) ; createRelativeSubmoduleSubscription ( superRepo , "master" , "../" , "nested/subscribed-to-project" , "master" ) ; org.eclipse.jgit.lib.ObjectId subHEAD = pushChangeTo ( subRepo , "master" ) ; expectToHaveSubmoduleState ( superRepo , "master" , "nested/subscribed-to-project" , subHEAD ) ; }

Target:
public void testSubscriptionFailOnWrongProjectACL ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < ? > superRepo = createProjectWithPush ( "super-project" ) ; org.eclipse.jgit.junit.TestRepository < ? > subRepo = createProjectWithPush ( "subscribed-to-project" ) ; allowMatchingSubmoduleSubscription ( "subscribed-to-project" , "refs/heads/master" , "wrong-super-project" , "refs/heads/master" ) ; pushChangeTo ( subRepo , "master" ) ; createSubmoduleSubscription ( superRepo , "master" , "subscribed-to-project" , "master" ) ; pushChangeTo ( subRepo , "master" ) ; com.google.common.truth.Truth.assertThat ( hasSubmodule ( superRepo , "master" , "subscribed-to-project" ) ) . isFalse ( ) ; }
Source:
private java.lang.String username ( final org.apache.sshd.common.session.AbstractSession s ) { if ( s == null ) { return "" ; } final com.google.gerrit.client.reviewdb.Account.Id id = s.getAttribute ( SshUtil.CURRENT_ACCOUNT ) ; if ( id == null ) { return "" ; } if ( numeric ) { return "a/" + ( id.toString ( ) ) ; } final com.google.gerrit.client.reviewdb.Account a = com.google.gerrit.client.rpc.Common.getAccountCache ( ) . get ( id ) ; return a != null ? a.getSshUserName ( ) : "" ; }

Target:
private java.lang.String username ( final org.apache.sshd.server.session.ServerSession s ) { if ( s == null ) { return "" ; } else if ( numeric ) { final com.google.gerrit.client.reviewdb.Account.Id id = s.getAttribute ( SshUtil.CURRENT_ACCOUNT ) ; return id != null ? "a/" + ( id.toString ( ) ) : "" ; } else { final java.lang.String user = s.getUsername ( ) ; return user != null ? user : "" ; } }
Source:
public void changeAssigneeOnReviewableChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; com.google.gerrit.acceptance.TestAccount other = accounts.create ( "other" , "other@example.com" , "other" ) ; assign ( sc , sc.owner , other ) ; sender.clear ( ) ; assign ( sc , sc.owner , sc.assignee ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer , other ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . to ( sc.assignee ) ; }

Target:
public void changeAssigneeToSelfOnReviewableChangeInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , sc.owner , sc.assignee ) ; sender.clear ( ) ; assign ( sc , sc.owner , sc.owner ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . noOneElse ( ) ; }
Source:
public void testSubscriptionWithoutGlobalServerSetting ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < ? > superRepo = createProjectWithPush ( "super-project" ) ; org.eclipse.jgit.junit.TestRepository < ? > subRepo = createProjectWithPush ( "subscribed-to-project" ) ; allowSubmoduleSubscription ( "subscribed-to-project" , "refs/heads/master" , "super-project" , "refs/heads/master" ) ; createSubmoduleSubscription ( superRepo , "master" , "subscribed-to-project" , "master" ) ; pushChangeTo ( subRepo , "master" ) ; com.google.common.truth.Truth.assertThat ( hasSubmodule ( superRepo , "master" , "subscribed-to-project" ) ) . isFalse ( ) ; }

Target:
public void testSubscriptionWithoutGlobalServerSetting ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < ? > superRepo = createProjectWithPush ( "super-project" ) ; org.eclipse.jgit.junit.TestRepository < ? > subRepo = createProjectWithPush ( "subscribed-to-project" ) ; allowMatchingSubmoduleSubscription ( "subscribed-to-project" , "refs/heads/master" , "super-project" , "refs/heads/master" ) ; createSubmoduleSubscription ( superRepo , "master" , "subscribed-to-project" , "master" ) ; pushChangeTo ( subRepo , "master" ) ; com.google.common.truth.Truth.assertThat ( hasSubmodule ( superRepo , "master" , "subscribed-to-project" ) ) . isFalse ( ) ; }
Source:
private void enable ( boolean enabled ) { commitMessage.setEnabled ( enabled ) ; commit.setEnabled ( enabled ) ; cancel1.setEnabled ( enabled ) ; cancel2.setEnabled ( enabled ) ; }

Target:
void onEdit ( com.google.gwt.event.dom.client.ClickEvent event ) { resetEditors ( ) ; edit.setEnabled ( false ) ; cancel1.setVisible ( true ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( commitTools , true ) ; commit.setVisible ( ( ! ( access.getOwnerOf ( ) . isEmpty ( ) ) ) ) ; review.setVisible ( access.canUpload ( ) ) ; accessEditor.setEditing ( true ) ; driver.edit ( access ) ; }
Source:
private static byte [ ] readFile ( final java.io.File p ) throws java.io.IOException { final java.io.FileInputStream in = new java.io.FileInputStream ( p ) ; try { final byte [ ] r = new byte [ ( ( int ) ( in.getChannel ( ) . size ( ) ) ) ] ; org.eclipse.jgit.util.NB.readFully ( in , r , 0 , r.length ) ; return r ; } finally { in.close ( ) ; } }

Target:
private static byte [ ] readFile ( final java.io.File p ) throws java.io.IOException { final java.io.FileInputStream in = new java.io.FileInputStream ( p ) ; try { final byte [ ] r = new byte [ ( ( int ) ( in.getChannel ( ) . size ( ) ) ) ] ; org.eclipse.jgit.util.IO.readFully ( in , r , 0 , r.length ) ; return r ; } finally { in.close ( ) ; } }
Source:
private static java.net.InetSocketAddress computePreferredAddress ( ) { for ( final java.net.SocketAddress addr : com.google.gerrit.server.ssh.GerritSshDaemon.sshd.listen ) { if ( ! ( addr instanceof java.net.InetSocketAddress ) ) { continue ; } java.net.InetSocketAddress inetAddr = ( ( java.net.InetSocketAddress ) ( addr ) ) ; if ( inetAddr.getAddress ( ) . isLoopbackAddress ( ) ) { continue ; } return inetAddr ; } return null ; }

Target:
private java.net.InetSocketAddress computePreferredAddress ( ) { for ( final java.net.SocketAddress addr : listen ) { if ( ! ( addr instanceof java.net.InetSocketAddress ) ) { continue ; } java.net.InetSocketAddress inetAddr = ( ( java.net.InetSocketAddress ) ( addr ) ) ; if ( inetAddr.getAddress ( ) . isLoopbackAddress ( ) ) { continue ; } return inetAddr ; } return null ; }
Source:
private org.eclipse.jgit.revwalk.RevCommit commit ( com.google.gerrit.server.notedb.ChangeUpdate update ) throws java.io.IOException { com.google.gerrit.server.git.MetaDataUpdate md = new com.google.gerrit.server.git.MetaDataUpdate ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.DISABLED , project , repo ) ; md.getCommitBuilder ( ) . setAuthor ( new org.eclipse.jgit.lib.PersonIdent ( update.getAccount ( ) . getFullName ( ) , update.getAccount ( ) . getPreferredEmail ( ) , update.getWhen ( ) , com.google.gerrit.server.notedb.ChangeNotesTest.TZ ) ) ; return update.commit ( md ) ; }

Target:
private org.eclipse.jgit.revwalk.RevCommit commit ( com.google.gerrit.server.notedb.ChangeUpdate update ) throws java.io.IOException { com.google.gerrit.server.git.MetaDataUpdate md = new com.google.gerrit.server.git.MetaDataUpdate ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.DISABLED , project , repo ) ; md.getCommitBuilder ( ) . setAuthor ( update.getUser ( ) . newCommitterIdent ( update.getWhen ( ) , com.google.gerrit.server.notedb.ChangeNotesTest.TZ ) ) ; return update.commit ( md ) ; }
Source:
public java.util.SortedSet < com.google.gerrit.reviewdb.client.Project.NameKey > list ( ) { namesUpdateLock.lock ( ) ; try { com.google.gerrit.server.git.LocalDiskRepositoryManager.ProjectVisitor visitor = new com.google.gerrit.server.git.LocalDiskRepositoryManager.ProjectVisitor ( ) ; try { java.nio.file.Files.walkFileTree ( basePath , java.util.EnumSet.of ( java.nio.file.FileVisitOption.FOLLOW_LINKS ) , java.lang.Integer.MAX_VALUE , visitor ) ; } catch ( java.io.IOException e ) { com.google.gerrit.server.git.LocalDiskRepositoryManager.log.error ( ( "Error walking repository tree " + ( basePath.toAbsolutePath ( ) ) ) , e ) ; } return java.util.Collections.unmodifiableSortedSet ( visitor.found ) ; } finally { namesUpdateLock.unlock ( ) ; } }

Target:
protected void scanProjects ( com.google.gerrit.server.git.LocalDiskRepositoryManager.ProjectVisitor visitor ) { try { java.nio.file.Files.walkFileTree ( visitor.startFolder , java.util.EnumSet.of ( java.nio.file.FileVisitOption.FOLLOW_LINKS ) , java.lang.Integer.MAX_VALUE , visitor ) ; } catch ( java.io.IOException e ) { com.google.gerrit.server.git.LocalDiskRepositoryManager.log.error ( ( "Error walking repository tree " + ( visitor.startFolder.toAbsolutePath ( ) ) ) , e ) ; } }
Source:
public void testGc ( ) throws java.lang.Exception { java.lang.String response = sshSession.exec ( ( ( ( ( "gerrit gc \"" + ( project.get ( ) ) ) + "\" \"" ) + ( project2.get ( ) ) ) + "\"" ) ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( sshSession.getError ( ) ) . that ( sshSession.hasError ( ) ) . isFalse ( ) ; assertNoError ( response ) ; gcAssert.assertHasPackFile ( project , project2 ) ; gcAssert.assertHasNoPackFile ( allProjects , project3 ) ; }

Target:
public void testGc ( ) throws java.lang.Exception { java.lang.String response = adminSshSession.exec ( ( ( ( ( "gerrit gc \"" + ( project.get ( ) ) ) + "\" \"" ) + ( project2.get ( ) ) ) + "\"" ) ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( adminSshSession.getError ( ) ) . that ( adminSshSession.hasError ( ) ) . isFalse ( ) ; assertNoError ( response ) ; gcAssert.assertHasPackFile ( project , project2 ) ; gcAssert.assertHasNoPackFile ( allProjects , project3 ) ; }
Source:
public boolean isRefVisible ( ) { return getRefControl ( ) . isVisible ( ) ; }

Target:
public boolean isPrivateVisible ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { return ( ( ( isOwner ( ) ) || ( isReviewer ( db , cd ) ) ) || ( getRefControl ( ) . canViewPrivateChanges ( ) ) ) || ( getUser ( ) . isInternalUser ( ) ) ; }
Source:
public com.googlesource.gerrit.plugins.serviceuser.GetConfig.ConfigInfo apply ( com.google.gerrit.server.config.ConfigResource rsrc ) { com.googlesource.gerrit.plugins.serviceuser.GetConfig.ConfigInfo info = new com.googlesource.gerrit.plugins.serviceuser.GetConfig.ConfigInfo ( ) ; info.info = com.google.common.base.Strings.emptyToNull ( cfg.getString ( "infoMessage" ) ) ; info.onSuccess = com.google.common.base.Strings.emptyToNull ( cfg.getString ( "onSuccessMessage" ) ) ; info.allowEmail = cfg.getBoolean ( "allowEmail" , false ) ; if ( ! ( info.allowEmail ) ) { info.allowEmail = null ; } return info ; }

Target:
public com.googlesource.gerrit.plugins.serviceuser.GetConfig.ConfigInfo apply ( com.google.gerrit.server.config.ConfigResource rsrc ) { com.googlesource.gerrit.plugins.serviceuser.GetConfig.ConfigInfo info = new com.googlesource.gerrit.plugins.serviceuser.GetConfig.ConfigInfo ( ) ; info.info = com.google.common.base.Strings.emptyToNull ( cfg.getString ( "infoMessage" ) ) ; info.onSuccess = com.google.common.base.Strings.emptyToNull ( cfg.getString ( "onSuccessMessage" ) ) ; info.allowEmail = com.googlesource.gerrit.plugins.serviceuser.GetConfig.toBoolean ( cfg.getBoolean ( "allowEmail" , false ) ) ; info.createNotes = com.googlesource.gerrit.plugins.serviceuser.GetConfig.toBoolean ( cfg.getBoolean ( "createNotes" , true ) ) ; info.createNotesAsync = com.googlesource.gerrit.plugins.serviceuser.GetConfig.toBoolean ( cfg.getBoolean ( "createNotesAsync" , false ) ) ; return info ; }
Source:
private void addSshKeys ( java.util.List < java.lang.String > sshKeys ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { for ( final java.lang.String sshKey : sshKeys ) { com.google.gerrit.server.account.AddSshKey.Input in = new com.google.gerrit.server.account.AddSshKey.Input ( ) ; in.raw = com.google.gerrit.common.RawInputUtil.create ( sshKey.getBytes ( ) , "plain/text" ) ; addSshKey.apply ( rsrc , in ) ; } }

Target:
private void addSshKeys ( java.util.List < java.lang.String > sshKeys ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { for ( final java.lang.String sshKey : sshKeys ) { com.google.gerrit.server.account.AddSshKey.Input in = new com.google.gerrit.server.account.AddSshKey.Input ( ) ; in.raw = com.google.gerrit.common.RawInputUtil.create ( sshKey.getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) , "plain/text" ) ; addSshKey.apply ( rsrc , in ) ; } }
Source:
public com.google.gerrit.client.ui.InlineHyperlink getNextPatchLink ( int index , com.google.gerrit.client.patches.PatchScreen.Type patchType ) { for ( index ++ ; index < ( patchList.size ( ) ) ; index ++ ) { com.google.gerrit.client.ui.InlineHyperlink link = createLink ( index , patchType , null , com.google.gwtexpui.safehtml.client.SafeHtml.asis ( Util.C.nextPatchLinkIcon ( ) ) ) ; if ( link != null ) { return link ; } } return null ; }

Target:
public int getPreviousPatch ( int currentIndex , com.google.gerrit.client.changes.PatchTable.PatchValidator ... validators ) { for ( int i = currentIndex - 1 ; i >= 0 ; i -- ) { com.google.gerrit.reviewdb.client.Patch patch = detail.getPatches ( ) . get ( i ) ; if ( ( patch != null ) && ( patchIsValid ( patch , validators ) ) ) { return i ; } } return - 1 ; }
Source:
protected void configure ( ) { bind ( com.ericsson.gerrit.plugins.highavailability.Configuration.class ) . in ( Scopes.SINGLETON ) ; install ( new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarderModule ( ) ) ; install ( new com.ericsson.gerrit.plugins.highavailability.event.EventModule ( ) ) ; install ( new com.ericsson.gerrit.plugins.highavailability.index.IndexModule ( ) ) ; install ( new com.ericsson.gerrit.plugins.highavailability.cache.CacheModule ( ) ) ; install ( new com.ericsson.gerrit.plugins.highavailability.peers.PeerInfoModule ( ) ) ; }

Target:
protected void configure ( ) { bind ( com.ericsson.gerrit.plugins.highavailability.Configuration.class ) . in ( Scopes.SINGLETON ) ; install ( new com.ericsson.gerrit.plugins.highavailability.forwarder.ForwarderModule ( ) ) ; install ( new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarderModule ( ) ) ; install ( new com.ericsson.gerrit.plugins.highavailability.event.EventModule ( ) ) ; install ( new com.ericsson.gerrit.plugins.highavailability.index.IndexModule ( ) ) ; install ( new com.ericsson.gerrit.plugins.highavailability.cache.CacheModule ( ) ) ; install ( new com.ericsson.gerrit.plugins.highavailability.peers.PeerInfoModule ( ) ) ; }
Source:
public void onBlur ( final com.google.gwt.event.dom.client.BlurEvent event ) { if ( "" . equals ( nameTxtBox.getText ( ) ) ) { nameTxtBox.setText ( Util.C.defaultAccountName ( ) ) ; nameTxtBox.addStyleName ( Gerrit.RESOURCES.css ( ) . inputFieldTypeHint ( ) ) ; } }

Target:
public void setEnabled ( boolean enabled ) { addMember.setEnabled ( enabled ) ; nameTxtBox.setEnabled ( enabled ) ; }
Source:
public java.util.SortedSet < com.google.gerrit.reviewdb.client.Project.NameKey > list ( ) { com.google.gerrit.server.git.LocalDiskRepositoryManager.ProjectVisitor visitor = new com.google.gerrit.server.git.LocalDiskRepositoryManager.ProjectVisitor ( basePath ) ; scanProjects ( visitor ) ; return java.util.Collections.unmodifiableSortedSet ( visitor.found ) ; }

Target:
public java.util.SortedSet < com.google.gerrit.reviewdb.client.Project.NameKey > list ( ) { com.google.gerrit.server.git.LocalDiskRepositoryManager.ProjectVisitor visitor = new com.google.gerrit.server.git.LocalDiskRepositoryManager.ProjectVisitor ( basePath ) ; scanProjects ( visitor ) ; namesUpdateLock.lock ( ) ; try { names = java.util.Collections.unmodifiableSortedSet ( visitor.found ) ; } finally { namesUpdateLock.unlock ( ) ; } return names ; }
Source:
private final org.bouncycastle.openpgp.PGPEncryptedDataGenerator cpk ( ) throws java.security.NoSuchProviderException , org.bouncycastle.openpgp.PGPException { org.bouncycastle.openpgp.PGPEncryptedDataGenerator cpk = new org.bouncycastle.openpgp.PGPEncryptedDataGenerator ( org.bouncycastle.openpgp.PGPEncryptedData.CAST5 , true , prng , "BC" ) ; cpk.addMethod ( dest ) ; return cpk ; }

Target:
private final org.bouncycastle.openpgp.PGPEncryptedDataGenerator cpk ( ) throws java.security.NoSuchProviderException , org.bouncycastle.openpgp.PGPException { final org.bouncycastle.openpgp.operator.bc.BcPGPDataEncryptorBuilder builder = new org.bouncycastle.openpgp.operator.bc.BcPGPDataEncryptorBuilder ( org.bouncycastle.openpgp.PGPEncryptedData.CAST5 ) . setSecureRandom ( prng ) ; org.bouncycastle.openpgp.PGPEncryptedDataGenerator cpk = new org.bouncycastle.openpgp.PGPEncryptedDataGenerator ( builder , true ) ; final org.bouncycastle.openpgp.operator.bc.BcPublicKeyKeyEncryptionMethodGenerator methodGenerator = new org.bouncycastle.openpgp.operator.bc.BcPublicKeyKeyEncryptionMethodGenerator ( dest ) ; cpk.addMethod ( methodGenerator ) ; return cpk ; }
Source:
public void invalidInputs ( ) { java.util.List < com.google.gerrit.extensions.api.config.AccessCheckInput > inputs = com.google.common.collect.ImmutableList.of ( new com.google.gerrit.extensions.api.config.AccessCheckInput ( ) , new com.google.gerrit.extensions.api.config.AccessCheckInput ( user.email , null , null ) , new com.google.gerrit.extensions.api.config.AccessCheckInput ( null , normalProject.toString ( ) , null ) , new com.google.gerrit.extensions.api.config.AccessCheckInput ( "doesnotexist@invalid.com" , normalProject.toString ( ) , null ) ) ; for ( com.google.gerrit.extensions.api.config.AccessCheckInput input : inputs ) { try { gApi.config ( ) . server ( ) . checkAccess ( input ) ; org.junit.Assert.fail ( java.lang.String.format ( "want RestApiException for %s" , newGson ( ) . toJson ( input ) ) ) ; } catch ( com.google.gerrit.extensions.restapi.RestApiException e ) { } } }

Target:
public void nonexistentEmail ( ) throws java.lang.Exception { exception.expect ( com.google.gerrit.extensions.restapi.UnprocessableEntityException.class ) ; exception.expectMessage ( "cannot find account doesnotexist@invalid.com" ) ; gApi.projects ( ) . name ( normalProject.get ( ) ) . checkAccess ( new com.google.gerrit.extensions.api.config.AccessCheckInput ( "doesnotexist@invalid.com" , null ) ) ; }
Source:
public static com.google.gerrit.common.data.LabelType withDefaultValues ( java.lang.String name ) { com.google.gerrit.common.data.LabelType.checkName ( name ) ; java.util.List < com.google.gerrit.common.data.LabelValue > values = new java.util.ArrayList < > ( 2 ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 0 ) ) , "Rejected" ) ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 1 ) ) , "Approved" ) ) ; return new com.google.gerrit.common.data.LabelType ( name , values ) ; }

Target:
public static com.google.gerrit.common.data.LabelType withDefaultValues ( java.lang.String name ) { com.google.gerrit.common.data.LabelType.checkName ( name ) ; return com.google.gerrit.common.data.LabelType.withDefaultValuesDoNotCheckName ( name ) ; }
Source:
public void listOneGroupMember ( ) throws java.lang.Exception { java.lang.String group = createGroup ( "group" ) ; java.lang.String user = createAccount ( "user1" , group ) ; assertMembers ( GET ( ( ( "/groups/" + group ) + "/members/" ) ) , user ) ; com.google.common.truth.Truth.assertThat ( GET_ONE ( ( ( ( "/groups/" + group ) + "/members/" ) + user ) ) . name ) . isEqualTo ( user ) ; }

Target:
public void listOneGroupMember ( ) throws java.lang.Exception { java.lang.String group = createGroup ( "group" ) ; java.lang.String user = createAccount ( "user1" , group ) ; assertMembers ( gApi.groups ( ) . id ( group ) . members ( ) , user ) ; }
Source:
public void format ( ) { org.junit.Assert.assertEquals ( "Code-Review-2" , com.google.gerrit.server.util.LabelVote.parse ( "Code-Review-2" ) . format ( ) ) ; org.junit.Assert.assertEquals ( "Code-Review-1" , com.google.gerrit.server.util.LabelVote.parse ( "Code-Review-1" ) . format ( ) ) ; org.junit.Assert.assertEquals ( "-Code-Review" , com.google.gerrit.server.util.LabelVote.parse ( "-Code-Review" ) . format ( ) ) ; org.junit.Assert.assertEquals ( "Code-Review" , com.google.gerrit.server.util.LabelVote.parse ( "Code-Review" ) . format ( ) ) ; org.junit.Assert.assertEquals ( "Code-Review+2" , com.google.gerrit.server.util.LabelVote.parse ( "Code-Review+2" ) . format ( ) ) ; }

Target:
public void format ( ) { org.junit.Assert.assertEquals ( "Code-Review-2" , com.google.gerrit.server.util.LabelVote.parse ( "Code-Review-2" ) . format ( ) ) ; org.junit.Assert.assertEquals ( "Code-Review-1" , com.google.gerrit.server.util.LabelVote.parse ( "Code-Review-1" ) . format ( ) ) ; org.junit.Assert.assertEquals ( "-Code-Review" , com.google.gerrit.server.util.LabelVote.parse ( "-Code-Review" ) . format ( ) ) ; org.junit.Assert.assertEquals ( "Code-Review+1" , com.google.gerrit.server.util.LabelVote.parse ( "Code-Review+1" ) . format ( ) ) ; org.junit.Assert.assertEquals ( "Code-Review+2" , com.google.gerrit.server.util.LabelVote.parse ( "Code-Review+2" ) . format ( ) ) ; }
Source:
public void checkRemoveReviewer ( com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.server.CurrentUser currentUser , com.google.gerrit.reviewdb.client.PatchSetApproval approval ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException { if ( canRemoveReviewerWithoutPermissionCheck ( notes.getChange ( ) , currentUser , approval.getAccountId ( ) , approval.getValue ( ) ) ) { return ; } permissionBackend.user ( currentUser ) . change ( notes ) . database ( dbProvider ) . check ( ChangePermission.REMOVE_REVIEWER ) ; }

Target:
private void checkRemoveReviewer ( com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.server.CurrentUser currentUser , com.google.gerrit.reviewdb.client.Account.Id reviewer , int val ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException { if ( canRemoveReviewerWithoutPermissionCheck ( notes.getChange ( ) , currentUser , reviewer , val ) ) { return ; } permissionBackend.user ( currentUser ) . change ( notes ) . database ( dbProvider ) . check ( ChangePermission.REMOVE_REVIEWER ) ; }
Source:
void onCtrlS ( com.google.gwt.event.dom.client.KeyDownEvent e ) { if ( ( e.isControlKeyDown ( ) ) && ( ( e.getNativeKeyCode ( ) ) == 83 ) ) { onSave ( null ) ; e.preventDefault ( ) ; } }

Target:
void onCtrlS ( com.google.gwt.event.dom.client.KeyDownEvent e ) { if ( ( ( ( e.isControlKeyDown ( ) ) || ( e.isMetaKeyDown ( ) ) ) && ( ! ( e.isAltKeyDown ( ) ) ) ) && ( ! ( e.isShiftKeyDown ( ) ) ) ) { switch ( e.getNativeKeyCode ( ) ) { case 's' : case 'S' : e.preventDefault ( ) ; onSave ( null ) ; return ; } } expandTimer.schedule ( 250 ) ; }
Source:
public void testSortWithRegex ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "^refs/heads/.*" ) ; com.google.gerrit.server.project.Util.allow ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "^refs/heads/.*-QA-.*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertTrue ( "u can read" , u.controlForRef ( "refs/heads/foo-QA-bar" ) . isVisible ( ) ) ; org.junit.Assert.assertTrue ( "d can read" , d.controlForRef ( "refs/heads/foo-QA-bar" ) . isVisible ( ) ) ; }

Target:
public void testSortWithRegex ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "^refs/heads/.*" ) ; com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "^refs/heads/.*-QA-.*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertTrue ( "u can read" , u.controlForRef ( "refs/heads/foo-QA-bar" ) . isVisible ( ) ) ; org.junit.Assert.assertTrue ( "d can read" , d.controlForRef ( "refs/heads/foo-QA-bar" ) . isVisible ( ) ) ; }
Source:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { com.google.gerrit.reviewdb.client.Change change = rsrc.getChange ( ) ; return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Move Change" ) . setTitle ( "Move change to a different branch" ) . setVisible ( ( ( ( change.getStatus ( ) . isOpen ( ) ) && ( permissionBackend.user ( rsrc.getUser ( ) ) . ref ( change.getDest ( ) ) . testOrFalse ( com.google.gerrit.server.permissions.RefPermission.CREATE_CHANGE ) ) ) && ( rsrc.permissions ( ) . database ( dbProvider ) . testOrFalse ( com.google.gerrit.server.permissions.ChangePermission.ABANDON ) ) ) ) ; }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { com.google.gerrit.reviewdb.client.Change change = rsrc.getChange ( ) ; return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Move Change" ) . setTitle ( "Move change to a different branch" ) . setVisible ( com.google.gerrit.extensions.conditions.BooleanCondition.and ( change.getStatus ( ) . isOpen ( ) , com.google.gerrit.extensions.conditions.BooleanCondition.and ( permissionBackend.user ( rsrc.getUser ( ) ) . ref ( change.getDest ( ) ) . testCond ( com.google.gerrit.server.permissions.RefPermission.CREATE_CHANGE ) , rsrc.permissions ( ) . database ( dbProvider ) . testCond ( com.google.gerrit.server.permissions.ChangePermission.ABANDON ) ) ) ) ; }
Source:
public boolean indexGroup ( final java.lang.String uuid ) { return new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.Request ( ( "index group " + uuid ) ) { @ java.lang.Override com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult send ( ) throws java.io.IOException { return httpSession.post ( com.google.common.base.Joiner.on ( "/" ) . join ( pluginRelativePath , "index/group" , uuid ) ) ; } } . execute ( ) ; }

Target:
public boolean indexGroup ( final java.lang.String uuid ) { return new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.Request ( "index group" , uuid ) { @ java.lang.Override com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult send ( ) throws java.io.IOException { return httpSession.post ( com.google.common.base.Joiner.on ( "/" ) . join ( pluginRelativePath , "index/group" , uuid ) ) ; } } . execute ( ) ; }
Source:
private void updateScreenHeader ( net.codemirror.lib.ScrollInfo si ) { if ( ( ( si.top ( ) ) == 0 ) && ( ! ( diffTable.isHeaderVisible ( ) ) ) ) { diffTable.setHeaderVisible ( true ) ; } else if ( ( ( si.top ( ) ) > ( 0.5 * ( si.clientHeight ( ) ) ) ) && ( diffTable.isHeaderVisible ( ) ) ) { diffTable.setHeaderVisible ( false ) ; } }

Target:
void setAutoHideDiffTableHeader ( boolean autoHide ) { if ( autoHide ) { updateDiffTableHeader ( cmB.getScrollInfo ( ) ) ; } else { diffTable.setHeaderVisible ( true ) ; } autoHideDiffTableHeader = autoHide ; }
Source:
public void onShowView ( ) { super . onShowView ( ) ; com.google.gwt.user.client.Window.enableScrolling ( false ) ; final int height = getCodeMirrorHeight ( ) ; cmA.setHeight ( height ) ; cmB.setHeight ( height ) ; diffTable.sidePanel.adjustGutters ( cmB ) ; cmB.setCursor ( net.codemirror.lib.LineCharacter.create ( 0 ) ) ; cmB.focus ( ) ; prefetchNextFile ( ) ; }

Target:
public void run ( ) { cmA.setHeight ( height ) ; cmB.setHeight ( height ) ; cmA.refresh ( ) ; cmB.refresh ( ) ; cmB.setCursor ( net.codemirror.lib.LineCharacter.create ( 0 ) ) ; cmB.focus ( ) ; }
Source:
public void onSuccess ( com.google.gwt.core.client.JavaScriptObject msg ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange2 ( id ) ) ; }

Target:
public void onSuccess ( com.google.gwt.core.client.JavaScriptObject msg ) { if ( com.google.gerrit.client.rpc.NativeString.is ( msg ) ) { com.google.gerrit.client.rpc.NativeString str = ( ( com.google.gerrit.client.rpc.NativeString ) ( msg ) ) ; if ( ! ( str.asString ( ) . isEmpty ( ) ) ) { com.google.gwt.user.client.Window.alert ( str.asString ( ) ) ; } } com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange2 ( id ) ) ; }
Source:
private static void createIndexes ( ) { com.google.gerrit.elasticsearch.ElasticAccountIndex.AccountMapping accountMapping = new com.google.gerrit.elasticsearch.ElasticAccountIndex.AccountMapping ( AccountSchemaDefinitions.INSTANCE.getLatest ( ) ) ; com.google.gerrit.elasticsearch.ElasticQueryAccountsTest.nodeInfo.node.client ( ) . admin ( ) . indices ( ) . prepareCreate ( com.google.gerrit.elasticsearch.ElasticQueryAccountsTest.INDEX_NAME ) . addMapping ( ElasticAccountIndex.ACCOUNTS , ElasticTestUtils.gson.toJson ( accountMapping ) ) . execute ( ) . actionGet ( ) ; }

Target:
public void cleanupIndex ( ) { if ( ( com.google.gerrit.elasticsearch.ElasticQueryAccountsTest.nodeInfo ) != null ) { com.google.gerrit.elasticsearch.ElasticTestUtils.deleteAllIndexes ( com.google.gerrit.elasticsearch.ElasticQueryAccountsTest.nodeInfo ) ; com.google.gerrit.elasticsearch.ElasticTestUtils.createAllIndexes ( com.google.gerrit.elasticsearch.ElasticQueryAccountsTest.nodeInfo ) ; } }
Source:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.googlecode.prolog_cafe.lang.Term a5 = engine.areg5 ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Iterator < com.google.gerrit.server.patch.PatchListEntry > iter = ( ( java.util.Iterator < com.google.gerrit.server.patch.PatchListEntry > ) ( ( ( com.googlecode.prolog_cafe.lang.JavaObjectTerm ) ( a5 ) ) . object ( ) ) ) ; if ( ! ( iter.hasNext ( ) ) ) { return engine.fail ( ) ; } return engine.jtry5 ( gerrit.PRED_commit_delta_4.commit_delta_check , gerrit.PRED_commit_delta_4.commit_delta_next ) ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.googlecode.prolog_cafe.lang.Term a5 = engine.r5 ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Iterator < com.google.gerrit.server.patch.PatchListEntry > iter = ( ( java.util.Iterator < com.google.gerrit.server.patch.PatchListEntry > ) ( ( ( com.googlecode.prolog_cafe.lang.JavaObjectTerm ) ( a5 ) ) . object ( ) ) ) ; if ( ! ( iter.hasNext ( ) ) ) { return engine.fail ( ) ; } return engine.jtry5 ( gerrit.PRED_commit_delta_4.commit_delta_check , gerrit.PRED_commit_delta_4.commit_delta_next ) ; }
Source:
public void onChangeEvent ( com.google.gerrit.server.events.ChangeEvent event ) { try { store.add ( com.googlesource.gerrit.plugins.events.CoreListener.gson.toJson ( event ) ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.events.CoreListener.log.error ( "Cannot add event to event store" , e ) ; } for ( com.googlesource.gerrit.plugins.events.StreamEventListener l : listeners ) { l.onStreamEventUpdate ( ) ; } }

Target:
public void onEvent ( com.google.gerrit.server.events.Event event ) { try { store.add ( com.googlesource.gerrit.plugins.events.CoreListener.gson.toJson ( event ) ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.events.CoreListener.log.error ( "Cannot add event to event store" , e ) ; } for ( com.googlesource.gerrit.plugins.events.StreamEventListener l : listeners ) { l.onStreamEventUpdate ( ) ; } }
Source:
public void customConflictMessageMultilineTest ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.automerger.FailedMergeException fme = new com.googlesource.gerrit.plugins.automerger.FailedMergeException ( failedMergeBranches , currentRevision , hostName , "${branch}a\nb\nc\nd" , topic ) ; com.google.common.truth.Truth.assertThat ( fme.getDisplayString ( ) . split ( "\\n" ) ) . asList ( ) . containsExactly ( "branch1a" , "b" , "c" , "d" , "branch2a" , "b" , "c" , "d" , "branch3a" , "b" , "c" , "d" ) ; }

Target:
public void customConflictMessageMultilineTest ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.automerger.FailedMergeException fme = new com.googlesource.gerrit.plugins.automerger.FailedMergeException ( failedMergeBranches , currentRevision , hostName , projectName , changeNumber , patchsetNumber , "${branch}a\nb\nc\nd" , topic ) ; com.google.common.truth.Truth.assertThat ( fme.getDisplayString ( ) . split ( "\\n" ) ) . asList ( ) . containsExactly ( "branch1a" , "b" , "c" , "d" , "branch2a" , "b" , "c" , "d" , "branch3a" , "b" , "c" , "d" ) ; }
Source:
public void delete ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { org.apache.lucene.index.Term id = idTerm ( cd ) ; if ( cd.getChange ( ) . getStatus ( ) . isOpen ( ) ) { openIndex.delete ( id ) ; } else { closedIndex.delete ( id ) ; } }

Target:
public void delete ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { org.apache.lucene.index.Term id = idTerm ( cd ) ; if ( readOnly ) { return ; } if ( cd.getChange ( ) . getStatus ( ) . isOpen ( ) ) { openIndex.delete ( id ) ; } else { closedIndex.delete ( id ) ; } }
Source:
public void onSuccess ( final com.google.gerrit.client.reviewdb.PatchLineComment result ) { if ( isNew ( ) ) { notifyDraftDelta ( 1 ) ; } comment = result ; text.setReadOnly ( false ) ; cancel.setEnabled ( true ) ; discard.setEnabled ( true ) ; render ( ) ; }

Target:
public void onSuccess ( final com.google.gerrit.client.reviewdb.PatchLineComment result ) { if ( isNew ( ) ) { notifyDraftDelta ( 1 ) ; } comment = result ; text.setReadOnly ( false ) ; save.setEnabled ( true ) ; cancel.setEnabled ( true ) ; discard.setEnabled ( true ) ; render ( ) ; }
Source:
void setShowIntraline ( boolean b ) { if ( b && ( ( getIntraLineStatus ( ) ) == ( DiffInfo.IntraLineStatus.OFF ) ) ) { reloadDiffInfo ( ) ; } else if ( b ) { diffTable.removeStyleName ( DiffTable.style.noIntraline ( ) ) ; } else { diffTable.addStyleName ( DiffTable.style.noIntraline ( ) ) ; } }

Target:
void addFileCommentBox ( com.google.gerrit.client.diff.CommentBox box ) { diffTable.addFileCommentBox ( box ) ; }
Source:
protected void configure ( ) { bind ( org.apache.http.impl.client.CloseableHttpClient.class ) . toProvider ( com.ericsson.gerrit.plugins.syncindex.HttpClientProvider.class ) . in ( Scopes.SINGLETON ) ; bind ( com.ericsson.gerrit.plugins.syncindex.Configuration.class ) . in ( Scopes.SINGLETON ) ; bind ( com.ericsson.gerrit.plugins.syncindex.HttpSession.class ) ; bind ( com.ericsson.gerrit.plugins.syncindex.RestSession.class ) ; bind ( java.util.concurrent.Executor.class ) . annotatedWith ( com.ericsson.gerrit.plugins.syncindex.SyncIndexExecutor.class ) . toProvider ( com.ericsson.gerrit.plugins.syncindex.SyncIndexExecutorProvider.class ) ; listener ( ) . to ( com.ericsson.gerrit.plugins.syncindex.SyncIndexExecutorProvider.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.ChangeIndexedListener.class ) . to ( com.ericsson.gerrit.plugins.syncindex.IndexEventHandler.class ) ; }

Target:
protected void configure ( ) { bind ( org.apache.http.impl.client.CloseableHttpClient.class ) . toProvider ( com.ericsson.gerrit.plugins.multimaster.HttpClientProvider.class ) . in ( Scopes.SINGLETON ) ; bind ( com.ericsson.gerrit.plugins.multimaster.Configuration.class ) . in ( Scopes.SINGLETON ) ; bind ( com.ericsson.gerrit.plugins.multimaster.HttpSession.class ) ; bind ( com.ericsson.gerrit.plugins.multimaster.RestSession.class ) ; bind ( java.util.concurrent.Executor.class ) . annotatedWith ( com.ericsson.gerrit.plugins.multimaster.SyncIndexExecutor.class ) . toProvider ( com.ericsson.gerrit.plugins.multimaster.SyncIndexExecutorProvider.class ) ; listener ( ) . to ( com.ericsson.gerrit.plugins.multimaster.SyncIndexExecutorProvider.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.ChangeIndexedListener.class ) . to ( com.ericsson.gerrit.plugins.multimaster.IndexEventHandler.class ) ; }
Source:
public long getContentLength ( ) { return sshKey.length ( ) ; }

Target:
private void addSshKeys ( java.util.List < java.lang.String > sshKeys ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException { for ( final java.lang.String sshKey : sshKeys ) { com.google.gerrit.server.account.AddSshKey.Input in = new com.google.gerrit.server.account.AddSshKey.Input ( ) ; in.raw = com.google.gerrit.common.RawInputUtil.create ( sshKey.getBytes ( ) , "plain/text" ) ; addSshKey.apply ( rsrc , in ) ; } }
Source:
public void save ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key1 = com.google.gerrit.gpg.testutil.TestKeys.key1 ( ) ; com.google.gerrit.gpg.testutil.TestKey key2 = com.google.gerrit.gpg.testutil.TestKeys.key2 ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; store.add ( key2.getPublicKeyRing ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) , key1 ) ; assertKeys ( key2.getKeyId ( ) , key2 ) ; }

Target:
public void save ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key1 = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithoutExpiration ( ) ; com.google.gerrit.gpg.testutil.TestKey key2 = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithExpiration ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; store.add ( key2.getPublicKeyRing ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) , key1 ) ; assertKeys ( key2.getKeyId ( ) , key2 ) ; }
Source:
public synchronized void onEvent ( final com.google.gerrit.server.events.Event event ) { if ( event instanceof com.google.gerrit.server.events.TopicChangedEvent ) { onTopicChanged ( ( ( com.google.gerrit.server.events.TopicChangedEvent ) ( event ) ) ) ; } else if ( event instanceof com.google.gerrit.server.events.PatchSetCreatedEvent ) { onPatchSetCreated ( ( ( com.google.gerrit.server.events.PatchSetCreatedEvent ) ( event ) ) ) ; } else if ( event instanceof com.google.gerrit.server.events.CommentAddedEvent ) { onCommendAdded ( ( ( com.google.gerrit.server.events.CommentAddedEvent ) ( event ) ) ) ; } }

Target:
public synchronized void onEvent ( final com.google.gerrit.server.events.Event event ) { if ( event instanceof com.google.gerrit.server.events.TopicChangedEvent ) { onTopicChanged ( ( ( com.google.gerrit.server.events.TopicChangedEvent ) ( event ) ) ) ; } else if ( event instanceof com.google.gerrit.server.events.PatchSetCreatedEvent ) { onPatchSetCreated ( ( ( com.google.gerrit.server.events.PatchSetCreatedEvent ) ( event ) ) ) ; } else if ( event instanceof com.google.gerrit.server.events.CommentAddedEvent ) { onCommentAdded ( ( ( com.google.gerrit.server.events.CommentAddedEvent ) ( event ) ) ) ; } }