auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private com.google.gerrit.sshd.SshSession newSession ( ) { final java.net.SocketAddress peer ; if ( ( peerAddress ) == null ) { peer = session.get ( ) . getRemoteAddress ( ) ; } else { peer = peerAddress ; } return new com.google.gerrit.sshd.SshSession ( session.get ( ) , peer , userFactory.create ( peer , accountId ) ) ; }

Target:
private com.google.gerrit.sshd.SshSession newSession ( ) { final java.net.SocketAddress peer ; if ( ( peerAddress ) == null ) { peer = session.get ( ) . getRemoteAddress ( ) ; } else { peer = peerAddress ; } com.google.gerrit.server.CurrentUser self = caller.get ( ) ; if ( self instanceof com.google.gerrit.server.PeerDaemonUser ) { self = null ; } return new com.google.gerrit.sshd.SshSession ( session.get ( ) , peer , userFactory.runAs ( peer , accountId , self ) ) ; }
Source:
public com.google.common.collect.ImmutableSet < com.google.gerrit.reviewdb.client.Branch.NameKey > getBranchesInOrder ( ) { return sortedBranches ; }

Target:
public com.google.common.collect.ImmutableSet < com.google.gerrit.reviewdb.client.Branch.NameKey > getBranchesInOrder ( ) { java.util.LinkedHashSet < com.google.gerrit.reviewdb.client.Branch.NameKey > branches = new java.util.LinkedHashSet < > ( ) ; if ( ( sortedBranches ) != null ) { branches.addAll ( sortedBranches ) ; } branches.addAll ( updatedBranches ) ; return com.google.common.collect.ImmutableSet.copyOf ( branches ) ; }
Source:
private com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > rewriteImpl ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in , com.google.gerrit.server.index.QueryOptions opts ) throws com.google.gerrit.index.query.QueryParseException { com.google.gerrit.server.index.change.ChangeIndex index = indexes.getSearchIndex ( ) ; org.eclipse.jgit.util.MutableInteger leafTerms = new org.eclipse.jgit.util.MutableInteger ( ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewriteImpl ( in , index , opts , leafTerms ) ; if ( ( in == out ) || ( out instanceof com.google.gerrit.server.index.IndexPredicate ) ) { return new com.google.gerrit.server.index.change.IndexedChangeQuery ( index , out , opts ) ; } else if ( out == null ) { return in ; } else { return out ; } }

Target:
private com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > rewriteImpl ( com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in , com.google.gerrit.index.QueryOptions opts ) throws com.google.gerrit.index.query.QueryParseException { com.google.gerrit.server.index.change.ChangeIndex index = indexes.getSearchIndex ( ) ; org.eclipse.jgit.util.MutableInteger leafTerms = new org.eclipse.jgit.util.MutableInteger ( ) ; com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewriteImpl ( in , index , opts , leafTerms ) ; if ( ( in == out ) || ( out instanceof com.google.gerrit.index.query.IndexPredicate ) ) { return new com.google.gerrit.server.index.change.IndexedChangeQuery ( index , out , opts ) ; } else if ( out == null ) { return in ; } else { return out ; } }
Source:
public void onFailure ( java.lang.Throwable caught ) { }

Target:
static void initLibrary ( final com.google.gwt.user.client.rpc.AsyncCallback < java.lang.Void > cb ) { if ( net.codemirror.lib.Loader.isLibLoaded ( ) ) { cb.onSuccess ( null ) ; } else { net.codemirror.lib.Loader.injectCss ( Lib.I.css ( ) ) ; net.codemirror.lib.Loader.injectScript ( Lib.I.js ( ) . getSafeUri ( ) , new com.google.gerrit.client.rpc.GerritCallback < java.lang.Void > ( ) { @ java.lang.Override public void onSuccess ( java.lang.Void result ) { net.codemirror.lib.Loader.initDisableUnwantedKeys ( ) ; cb.onSuccess ( null ) ; } } ) ; } }
Source:
public void testAppend_double ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; assertSame ( b , b.append ( 0.0 ) ) ; assertEquals ( "0.0" , b.asString ( ) ) ; }

Target:
public void testAppend_String ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.append ( ( ( java.lang.String ) ( null ) ) ) ) ; org.junit.Assert.assertEquals ( "" , b.asString ( ) ) ; org.junit.Assert.assertSame ( b , b.append ( "foo" ) ) ; org.junit.Assert.assertSame ( b , b.append ( "bar" ) ) ; org.junit.Assert.assertEquals ( "foobar" , b.asString ( ) ) ; }
Source:
private org.eclipse.jgit.revwalk.RevCommit getCurrentCommit ( com.google.gerrit.acceptance.PushOneCommit.Result change ) throws java.lang.Exception { testRepo.git ( ) . fetch ( ) . setRemote ( "origin" ) . call ( ) ; com.google.gerrit.extensions.common.ChangeInfo info = get ( change.getChangeId ( ) ) ; org.eclipse.jgit.revwalk.RevCommit c = testRepo.getRevWalk ( ) . parseCommit ( org.eclipse.jgit.lib.ObjectId.fromString ( info.currentRevision ) ) ; testRepo.getRevWalk ( ) . parseBody ( c ) ; return c ; }

Target:
private org.eclipse.jgit.revwalk.RevCommit getCurrentCommit ( com.google.gerrit.acceptance.PushOneCommit.Result change ) throws java.lang.Exception { testRepo.git ( ) . fetch ( ) . setRemote ( "origin" ) . call ( ) ; com.google.gerrit.extensions.common.ChangeInfo info = get ( change.getChangeId ( ) , com.google.gerrit.extensions.client.ListChangesOption.CURRENT_REVISION ) ; org.eclipse.jgit.revwalk.RevCommit c = testRepo.getRevWalk ( ) . parseCommit ( org.eclipse.jgit.lib.ObjectId.fromString ( info.currentRevision ) ) ; testRepo.getRevWalk ( ) . parseBody ( c ) ; return c ; }
Source:
static com.google.gerrit.server.query.change.ChangeData createForTest ( com.google.gerrit.reviewdb.client.Change.Id id ) { return new com.google.gerrit.server.query.change.ChangeData ( null , null , null , null , null , null , null , null , id ) ; }

Target:
static com.google.gerrit.server.query.change.ChangeData createForTest ( com.google.gerrit.reviewdb.client.Change.Id id , int currentPatchSetId ) { com.google.gerrit.server.query.change.ChangeData cd = new com.google.gerrit.server.query.change.ChangeData ( null , null , null , null , null , null , null , null , id ) ; cd.currentPatchSet = new com.google.gerrit.reviewdb.client.PatchSet ( new com.google.gerrit.reviewdb.client.PatchSet.Id ( id , currentPatchSetId ) ) ; return cd ; }
Source:
, @ com.google.gerrit.acceptance.GerritConfig ( name = "suggest.from" , value = "1" ) , @ com.google.gerrit.acceptance.GerritConfig ( name = "accounts.visibility" , value = "NONE" ) } ) public void suggestReviewersNoResult2 ( ) throws java.io.IOException , java.lang.Exception , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.util.List < com.google.gerrit.server.change.SuggestReviewers.SuggestedReviewerInfo > reviewers = suggestReviewers ( changeId , "u" , 6 ) ; org.junit.Assert.assertEquals ( reviewers.size ( ) , 0 ) ; }

Target:
, @ com.google.gerrit.acceptance.GerritConfig ( name = "suggest.from" , value = "1" ) , @ com.google.gerrit.acceptance.GerritConfig ( name = "accounts.visibility" , value = "NONE" ) } ) public void suggestReviewersNoResult2 ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > reviewers = suggestReviewers ( changeId , "u" , 6 ) ; com.google.common.truth.Truth.assertThat ( reviewers ) . isEmpty ( ) ; }
Source:
public void display ( final java.util.List < com.google.gerrit.reviewdb.client.Project > projects ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.reviewdb.client.Project k : projects ) insert ( table.getRowCount ( ) , k ) ; finishDisplay ( ) ; }

Target:
public int compare ( com.google.gerrit.client.projects.ProjectInfo a , com.google.gerrit.client.projects.ProjectInfo b ) { return a.name ( ) . compareTo ( b.name ( ) ) ; }
Source:
protected void onStarClick ( final int row ) { final com.google.gerrit.client.changes.ChangeInfo c = getRowItem ( row ) ; if ( ( c != null ) && ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.changes.ChangeCache.get ( c.legacy_id ( ) ) . getStarCache ( ) . toggleStar ( ) ; } }

Target:
public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { int row = getCurrentRow ( ) ; com.google.gerrit.client.changes.ChangeInfo c = getRowItem ( row ) ; if ( ( c != null ) && ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { ( ( com.google.gerrit.client.changes.StarredChanges.Icon ) ( table.getWidget ( row , com.google.gerrit.client.changes.ChangeTable2.C_STAR ) ) ) . toggleStar ( ) ; } }
Source:
public com.google.gerrit.server.plugins.InstallPlugin create ( com.google.gerrit.extensions.restapi.TopLevelResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.ResourceNotFoundException { if ( ! ( loader.isRemoteAdminEnabled ( ) ) ) { throw new com.google.gerrit.extensions.restapi.MethodNotAllowedException ( "remote installation is disabled" ) ; } return new com.google.gerrit.server.plugins.InstallPlugin ( loader , id.get ( ) , true ) ; }

Target:
public com.google.gerrit.server.plugins.InstallPlugin create ( com.google.gerrit.extensions.restapi.TopLevelResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.ResourceNotFoundException { if ( ! ( loader.isRemoteAdminEnabled ( ) ) ) { throw new com.google.gerrit.extensions.restapi.MethodNotAllowedException ( "remote installation is disabled" ) ; } return install.get ( ) . setName ( id.get ( ) ) . setCreated ( true ) ; }
Source:
private void display ( final com.google.gerrit.reviewdb.AccountGeneralPreferences p ) { showSiteHeader.setValue ( p.isShowSiteHeader ( ) ) ; useFlashClipboard.setValue ( p.isUseFlashClipboard ( ) ) ; copySelfOnEmails.setValue ( p.isCopySelfOnEmails ( ) ) ; setListBox ( maximumPageSize , com.google.gerrit.reviewdb.AccountGeneralPreferences.DEFAULT_PAGESIZE , p.getMaximumPageSize ( ) ) ; setListBox ( dateFormat , AccountGeneralPreferences.DateFormat.STD , p.getDateFormat ( ) ) ; setListBox ( timeFormat , AccountGeneralPreferences.TimeFormat.HHMM_12 , p.getTimeFormat ( ) ) ; }

Target:
private void display ( final com.google.gerrit.reviewdb.AccountGeneralPreferences p ) { showSiteHeader.setValue ( p.isShowSiteHeader ( ) ) ; useFlashClipboard.setValue ( p.isUseFlashClipboard ( ) ) ; copySelfOnEmails.setValue ( p.isCopySelfOnEmails ( ) ) ; displayPatchSetsInReverseOrder.setValue ( p.isDisplayPatchSetsInReverseOrder ( ) ) ; setListBox ( maximumPageSize , com.google.gerrit.reviewdb.AccountGeneralPreferences.DEFAULT_PAGESIZE , p.getMaximumPageSize ( ) ) ; setListBox ( dateFormat , AccountGeneralPreferences.DateFormat.STD , p.getDateFormat ( ) ) ; setListBox ( timeFormat , AccountGeneralPreferences.TimeFormat.HHMM_12 , p.getTimeFormat ( ) ) ; }
Source:
protected com.google.gerrit.prettify.client.SparseHtmlFile getSparseHtmlFileA ( com.google.gerrit.common.data.PatchScript s ) { com.google.gerrit.reviewdb.client.AccountDiffPreference dp = new com.google.gerrit.reviewdb.client.AccountDiffPreference ( s.getDiffPrefs ( ) ) ; dp.setShowWhitespaceErrors ( false ) ; com.google.gerrit.prettify.client.PrettyFormatter f = ClientSideFormatter.FACTORY.get ( ) ; f.setDiffPrefs ( dp ) ; f.setFileName ( s.getA ( ) . getPath ( ) ) ; f.setEditFilter ( PrettyFormatter.A ) ; f.setEditList ( s.getEdits ( ) ) ; f.format ( s.getA ( ) ) ; return f ; }

Target:
protected com.google.gerrit.prettify.client.SparseHtmlFile getSparseHtmlFileA ( com.google.gerrit.common.data.PatchScript s ) { com.google.gerrit.extensions.client.DiffPreferencesInfo dp = s.getDiffPrefs ( ) ; dp.showWhitespaceErrors = false ; com.google.gerrit.prettify.client.PrettyFormatter f = ClientSideFormatter.FACTORY.get ( ) ; f.setDiffPrefs ( dp ) ; f.setFileName ( s.getA ( ) . getPath ( ) ) ; f.setEditFilter ( PrettyFormatter.A ) ; f.setEditList ( s.getEdits ( ) ) ; f.format ( s.getA ( ) ) ; return f ; }
Source:
public java.util.List < com.google.gerrit.server.notedb.ChangeNotes > scan ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( ! ( migration.readChanges ( ) ) ) { return scanDb ( repo , db ) ; } return scanNotedb ( repo , db , project ) ; }

Target:
public java.util.List < com.google.gerrit.server.notedb.ChangeNotes > scan ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( ! ( migration.readChanges ( ) ) ) { return scanDb ( repo , db ) ; } return scanNoteDb ( repo , db , project ) ; }
Source:
void onSave ( com.google.gwt.event.dom.client.ClickEvent e ) { com.google.gerrit.client.changes.ChangeFileApi.putContent ( id , file , message.getText ( ) . trim ( ) , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( id.getParentKey ( ) ) ) ; hide ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }

Target:
void onSave ( com.google.gwt.event.dom.client.ClickEvent e ) { com.google.gerrit.client.changes.ChangeFileApi.putContent ( id , file.getText ( ) , content.getText ( ) , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( id.getParentKey ( ) ) ) ; hide ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }
Source:
public void testNonIndexPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "foo:a OR foo:b" ) ; com.google.common.truth.Truth.assertThat ( in ) . isEqualTo ( rewrite ( in ) ) ; }

Target:
public void testNonIndexPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "foo:a OR foo:b" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.query.change.AndSource.class ) . isSameAs ( out.getClass ( ) ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( com.google.gerrit.server.query.change.ChangeStatusPredicate.open ( ) ) , in ) . inOrder ( ) ; }
Source:
private boolean authLogin ( java.lang.String smtpUser , java.lang.String smtpPass ) throws java.io.IOException , java.io.UnsupportedEncodingException { if ( ( sendCommand ( "AUTH" , "LOGIN" ) ) != 334 ) { return false ; } java.lang.String cmd = org.apache.commons.net.smtp.AuthSMTPClient.encodeBase64 ( smtpUser.getBytes ( org.apache.commons.net.smtp.AuthSMTPClient.UTF_8 ) ) ; if ( ( sendCommand ( cmd ) ) != 334 ) { return false ; } cmd = org.apache.commons.net.smtp.AuthSMTPClient.encodeBase64 ( smtpPass.getBytes ( org.apache.commons.net.smtp.AuthSMTPClient.UTF_8 ) ) ; return org.apache.commons.net.smtp.SMTPReply.isPositiveCompletion ( sendCommand ( cmd ) ) ; }

Target:
private boolean authLogin ( java.lang.String smtpUser , java.lang.String smtpPass ) throws java.io.IOException , java.io.UnsupportedEncodingException { if ( ( sendCommand ( "AUTH" , "LOGIN" ) ) != 334 ) { return false ; } java.lang.String cmd = org.apache.commons.net.smtp.AuthSMTPClient.encodeBase64 ( smtpUser.getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; if ( ( sendCommand ( cmd ) ) != 334 ) { return false ; } cmd = org.apache.commons.net.smtp.AuthSMTPClient.encodeBase64 ( smtpPass.getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; return org.apache.commons.net.smtp.SMTPReply.isPositiveCompletion ( sendCommand ( cmd ) ) ; }
Source:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.validators.ProjectCreationValidationListener.class ) . to ( com.googlesource.gerrit.plugins.quota.MaxRepositoriesQuotaValidator.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.git.ReceivePackInitializer.class ) . to ( com.googlesource.gerrit.plugins.quota.MaxRepositorySizeQuota.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , org.eclipse.jgit.transport.PostReceiveHook.class ) . to ( com.googlesource.gerrit.plugins.quota.MaxRepositorySizeQuota.class ) ; install ( com.googlesource.gerrit.plugins.quota.MaxRepositorySizeQuota.module ( ) ) ; }

Target:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.validators.ProjectCreationValidationListener.class ) . to ( com.googlesource.gerrit.plugins.quota.MaxRepositoriesQuotaValidator.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.git.ReceivePackInitializer.class ) . to ( com.googlesource.gerrit.plugins.quota.MaxRepositorySizeQuota.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , org.eclipse.jgit.transport.PostReceiveHook.class ) . to ( com.googlesource.gerrit.plugins.quota.MaxRepositorySizeQuota.class ) ; install ( com.googlesource.gerrit.plugins.quota.MaxRepositorySizeQuota.module ( ) ) ; install ( new com.google.gerrit.extensions.restapi.RestApiModule ( ) { @ java.lang.Override protected void configure ( ) { get ( com.google.gerrit.server.project.ProjectResource.PROJECT_KIND , "quota" ) . to ( com.googlesource.gerrit.plugins.quota.GetQuota.class ) ; } } ) ; }
Source:
com.googlesource.gerrit.plugins.cfoauth.AccessToken parseAccessTokenResponse ( 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 toAccessToken ( 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 createEmptyEditRest ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( adminSession.post ( urlEdit ( ) ) . getStatusCode ( ) ) . isEqualTo ( org.apache.http.HttpStatus.SC_NO_CONTENT ) ; com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( change ) ; com.google.gerrit.acceptance.edit.ChangeEditIT.assertByteArray ( fileUtil.getContent ( projectCache.get ( edit.get ( ) . getChange ( ) . getProject ( ) ) , org.eclipse.jgit.lib.ObjectId.fromString ( edit.get ( ) . getRevision ( ) . get ( ) ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME ) , com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_OLD ) ; }

Target:
public void createEmptyEditRest ( ) throws java.lang.Exception { adminSession.post ( urlEdit ( ) ) . assertNoContent ( ) ; com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( change ) ; com.google.gerrit.acceptance.edit.ChangeEditIT.assertByteArray ( fileUtil.getContent ( projectCache.get ( edit.get ( ) . getChange ( ) . getProject ( ) ) , org.eclipse.jgit.lib.ObjectId.fromString ( edit.get ( ) . getRevision ( ) . get ( ) ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME ) , com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_OLD ) ; }
Source:
public final com.google.gerrit.gpg.CheckResult check ( org.bouncycastle.openpgp.PGPPublicKey key , com.google.gerrit.gpg.PublicKeyStore store ) { if ( ( trusted ) == null ) { return check ( key ) ; } else if ( store == null ) { throw new java.lang.IllegalArgumentException ( "PublicKeyStore required for web of trust checks" ) ; } return check ( key , store , 0 , true , new java.util.HashSet < com.google.gerrit.gpg.Fingerprint > ( ) ) ; }

Target:
public final com.google.gerrit.gpg.CheckResult check ( org.bouncycastle.openpgp.PGPPublicKey key ) { if ( ( ( store ) == null ) && ( ( trusted ) != null ) ) { throw new java.lang.IllegalStateException ( "PublicKeyStore is required" ) ; } return check ( key , 0 , true , ( ( trusted ) != null ? new java.util.HashSet < com.google.gerrit.gpg.Fingerprint > ( ) : null ) ) ; }
Source:
public void run ( ) { for ( int i = 0 ; i < ( ( group.size ( ) ) - 1 ) ; i ++ ) { group.get ( i ) . setValue ( false , false ) ; } group.get ( ( ( group.size ( ) ) - 1 ) ) . setValue ( true , true ) ; }

Target:
void selectMax ( ) { for ( int i = 0 ; i < ( ( buttons.size ( ) ) - 1 ) ; i ++ ) { buttons.get ( i ) . setValue ( false , false ) ; } com.google.gerrit.client.change.ReplyBox.LabelRadioButton max = buttons.get ( ( ( buttons.size ( ) ) - 1 ) ) ; max.setValue ( true , true ) ; max.select ( ) ; }
Source:
private void merge ( com.google.gerrit.acceptance.PushOneCommit.Result r ) throws java.lang.Exception { revision ( r ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) ) ; revision ( r ) . submit ( ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ) { com.google.common.truth.Truth.assertThat ( repo.exactRef ( "refs/heads/master" ) . getObjectId ( ) ) . isEqualTo ( r.getCommitId ( ) ) ; } }

Target:
private void merge ( com.google.gerrit.acceptance.PushOneCommit.Result r ) throws java.lang.Exception { revision ( r ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) ) ; revision ( r ) . submit ( ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ) { com.google.common.truth.Truth.assertThat ( repo.exactRef ( "refs/heads/master" ) . getObjectId ( ) ) . isEqualTo ( r.getCommit ( ) ) ; } }
Source:
public void run ( ) throws com.google.gerrit.sshd.commands.Failure { parseCommandLine ( ) ; boolean ok = true ; for ( com.google.gerrit.reviewdb.client.Change.Id changeId : changes ) { try { ok &= modifyOne ( changeId ) ; } catch ( java.lang.Exception err ) { ok = false ; com.google.gerrit.sshd.commands.SetReviewersCommand.log.error ( ( "Error updating reviewers on change " + changeId ) , err ) ; writeError ( "fatal" , ( "internal error while updating " + changeId ) ) ; } } if ( ! ok ) { throw com.google.gerrit.sshd.commands.SetReviewersCommand.error ( "fatal: one or more updates failed; review output above" ) ; } }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { boolean ok = true ; for ( com.google.gerrit.reviewdb.client.Change.Id changeId : changes ) { try { ok &= modifyOne ( changeId ) ; } catch ( java.lang.Exception err ) { ok = false ; com.google.gerrit.sshd.commands.SetReviewersCommand.log.error ( ( "Error updating reviewers on change " + changeId ) , err ) ; writeError ( "fatal" , ( "internal error while updating " + changeId ) ) ; } } if ( ! ok ) { throw com.google.gerrit.sshd.commands.SetReviewersCommand.error ( "fatal: one or more updates failed; review output above" ) ; } }
Source:
public void parseBranch ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Patch-Set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( ( "\n" + "Branch: master\n" ) + "Patch-Set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Branch: refs/heads/stable" ) ) ) ; }

Target:
public void parseBranch ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-Set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-Set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Branch: refs/heads/stable" ) ) ) ; }
Source:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.PrologException { engine.cont = cont ; engine.setB0 ( ) ; com.vmware.gerrit.owners.common.PathOwners owners = OwnersStoredValues.PATH_OWNERS.get ( engine ) ; engine.areg1 = arg1 ; engine.areg2 = new com.googlecode.prolog_cafe.lang.JavaObjectTerm ( owners.get ( ) . keys ( ) . iterator ( ) ) ; return engine.jtry2 ( gerrit_owners.PRED_owner_path_1.OWNER_PATH_CHECK , gerrit_owners.PRED_owner_path_1.OWNER_PATH_NEXT ) ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.exceptions.PrologException { engine.cont = cont ; engine.setB0 ( ) ; com.vmware.gerrit.owners.common.PathOwners owners = OwnersStoredValues.PATH_OWNERS.get ( engine ) ; engine.r1 = arg1 ; engine.r2 = new com.googlecode.prolog_cafe.lang.JavaObjectTerm ( owners.get ( ) . keys ( ) . iterator ( ) ) ; return engine.jtry2 ( gerrit_owners.PRED_owner_path_1.OWNER_PATH_CHECK , gerrit_owners.PRED_owner_path_1.OWNER_PATH_NEXT ) ; }
Source:
private void configurePeerInfoSection ( ) { ui.header ( "PeerInfo section" ) ; promptAndSetString ( "Peer URL" , com.ericsson.gerrit.plugins.highavailability.PEER_INFO_SECTION , com.ericsson.gerrit.plugins.highavailability.URL_KEY , null ) ; }

Target:
private void configureMainSection ( ) { ui.header ( "Main section" ) ; java.lang.String sharedDirDefault = ( ui.isBatch ( ) ) ? com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_SHARED_DIRECTORY : null ; java.lang.String shared = promptAndSetString ( "Shared directory" , com.ericsson.gerrit.plugins.highavailability.Configuration.MAIN_SECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.SHARED_DIRECTORY_KEY , sharedDirDefault ) ; if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( shared ) ) ) { java.nio.file.Path resolved = site.site_path.resolve ( java.nio.file.Paths.get ( shared ) ) ; com.google.gerrit.common.FileUtil.mkdirsOrDie ( resolved , ( "cannot create " + resolved ) ) ; } }
Source:
private com.google.gerrit.server.git.TagSet rebuild ( org.eclipse.jgit.lib.Repository db , com.google.gerrit.server.git.TagSet old , com.google.gerrit.server.git.TagMatcher m ) { synchronized ( buildLock ) { com.google.gerrit.server.git.TagSet cur = this . tags ; if ( cur == old ) { cur = new com.google.gerrit.server.git.TagSet ( projectName ) ; cur.build ( db , old , m ) ; this . tags = cur ; } return cur ; } }

Target:
private com.google.gerrit.server.git.TagSet rebuild ( com.google.gerrit.server.git.TagCache cache , org.eclipse.jgit.lib.Repository db , com.google.gerrit.server.git.TagSet old , com.google.gerrit.server.git.TagMatcher m ) { synchronized ( buildLock ) { com.google.gerrit.server.git.TagSet cur = this . tags ; if ( cur == old ) { cur = new com.google.gerrit.server.git.TagSet ( projectName ) ; cur.build ( db , old , m ) ; this . tags = cur ; cache.put ( projectName , this ) ; } return cur ; } }
Source:
void display ( final java.util.List < com.google.gerrit.client.reviewdb.Project > result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.client.reviewdb.Project k : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; populate ( row , k ) ; } }

Target:
void display ( final java.util.List < com.google.gerrit.client.reviewdb.Project > result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.client.reviewdb.Project k : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , k ) ; } }
Source:
private com.google.gwt.user.client.Element getRow ( com.google.gwt.user.client.Element e ) { for ( com.google.gwt.user.client.Element prev = e ; e != null ; prev = e ) { if ( ( e = com.google.gwt.user.client.DOM.getParent ( e ) ) == ( body ) ) { return prev ; } } return null ; }

Target:
private com.google.gwt.dom.client.Element getRow ( com.google.gwt.dom.client.Element e ) { for ( com.google.gwt.dom.client.Element prev = e ; e != null ; prev = e ) { if ( ( e = com.google.gwt.user.client.DOM.getParent ( e ) ) == ( body ) ) { return prev ; } } return null ; }
Source:
private void padLineNumber ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , boolean isForTableHeader , boolean isForSideA ) { m.openTd ( ) ; m.setStyleName ( Gerrit.RESOURCES.css ( ) . lineNumber ( ) ) ; if ( isForTableHeader ) { m.addStyleName ( Gerrit.RESOURCES.css ( ) . fileColumnHeader ( ) ) ; } if ( isForSideA ) { m.addStyleName ( Gerrit.RESOURCES.css ( ) . rightBorder ( ) ) ; } m.closeTd ( ) ; }

Target:
private void padLineNumberForSideB ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m ) { m.openTd ( ) ; m.setStyleName ( Gerrit.RESOURCES.css ( ) . lineNumber ( ) ) ; m.closeTd ( ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { index = new com.google.gerrit.server.index.change.FakeChangeIndex ( FakeChangeIndex.V2 ) ; indexes = new com.google.gerrit.server.index.change.ChangeIndexCollection ( ) ; indexes.setSearchIndex ( index ) ; queryBuilder = new com.google.gerrit.server.index.change.FakeQueryBuilder ( indexes ) ; rewrite = new com.google.gerrit.server.index.change.ChangeIndexRewriter ( indexes , com.google.gerrit.server.index.IndexConfig.create ( 0 , 0 , 3 ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { index = new com.google.gerrit.server.index.change.FakeChangeIndex ( FakeChangeIndex.V2 ) ; indexes = new com.google.gerrit.server.index.change.ChangeIndexCollection ( ) ; indexes.setSearchIndex ( index ) ; queryBuilder = new com.google.gerrit.server.index.change.FakeQueryBuilder ( indexes ) ; rewrite = new com.google.gerrit.server.index.change.ChangeIndexRewriter ( indexes , com.google.gerrit.server.index.IndexConfig.builder ( ) . maxTerms ( 3 ) . build ( ) ) ; }
Source:
public void addAllReviewers ( com.google.gerrit.server.data.ChangeAttribute a , com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException { java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > reviewers = approvalsUtil.getReviewers ( db.get ( ) , change.getId ( ) ) . values ( ) ; if ( ! ( reviewers.isEmpty ( ) ) ) { a.allReviewers = com.google.common.collect.Lists.newArrayListWithCapacity ( reviewers.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Account.Id id : reviewers ) { a.allReviewers.add ( asAccountAttribute ( id ) ) ; } } }

Target:
public void addAllReviewers ( com.google.gerrit.server.data.ChangeAttribute a , com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gwtorm.server.OrmException { java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > reviewers = approvalsUtil.getReviewers ( db.get ( ) , notes ) . values ( ) ; if ( ! ( reviewers.isEmpty ( ) ) ) { a.allReviewers = com.google.common.collect.Lists.newArrayListWithCapacity ( reviewers.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Account.Id id : reviewers ) { a.allReviewers.add ( asAccountAttribute ( id ) ) ; } } }
Source:
public void setUp ( ) { listenerMock = createMock ( com.google.gerrit.common.EventListener.class ) ; com.google.gerrit.extensions.registration.DynamicSet < com.google.gerrit.common.EventListener > listeners = com.google.gerrit.extensions.registration.DynamicSet.emptySet ( ) ; listeners.add ( listenerMock ) ; broker = new com.ericsson.gerrit.plugins.syncevents.SyncEventBroker ( null , listeners , null , null , null ) ; }

Target:
public void setUp ( ) { listenerMock = org.mockito.Mockito.mock ( com.google.gerrit.common.EventListener.class ) ; com.google.gerrit.extensions.registration.DynamicSet < com.google.gerrit.common.EventListener > listeners = com.google.gerrit.extensions.registration.DynamicSet.emptySet ( ) ; listeners.add ( listenerMock ) ; broker = new com.ericsson.gerrit.plugins.syncevents.SyncEventBroker ( null , listeners , null , null , null ) ; }
Source:
private com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DownloadScheme getSelectedScheme ( ) { java.lang.String id = scheme.getValue ( scheme.getSelectedIndex ( ) ) ; if ( "git" . equals ( id ) ) { return com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DownloadScheme.ANON_GIT ; } else if ( "http" . equals ( id ) ) { return com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DownloadScheme.HTTP ; } else if ( "ssh" . equals ( id ) ) { return com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DownloadScheme.SSH ; } return null ; }

Target:
private com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DownloadScheme getSelectedScheme ( ) { java.lang.String id = scheme.getValue ( scheme.getSelectedIndex ( ) ) ; if ( "git" . equals ( id ) ) { return com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DownloadScheme.ANON_GIT ; } else if ( "anonymous http" . equals ( id ) ) { return com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DownloadScheme.ANON_HTTP ; } else if ( "http" . equals ( id ) ) { return com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DownloadScheme.HTTP ; } else if ( "ssh" . equals ( id ) ) { return com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DownloadScheme.SSH ; } else if ( "repo" . equals ( id ) ) { return com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DownloadScheme.REPO_DOWNLOAD ; } return null ; }
Source:
private com.google.common.collect.SetMultimap < org.eclipse.jgit.lib.ObjectId , org.eclipse.jgit.lib.Ref > changeRefsById ( ) { if ( ( refsById ) == null ) { refsById = com.google.common.collect.HashMultimap.create ( ) ; for ( org.eclipse.jgit.lib.Ref r : refsByChange ( ) . values ( ) ) { refsById.put ( r.getObjectId ( ) , r ) ; } } return refsById ; }

Target:
private com.google.common.collect.SetMultimap < org.eclipse.jgit.lib.ObjectId , org.eclipse.jgit.lib.Ref > changeRefsById ( ) { initChangeRefMaps ( ) ; return refsById ; }
Source:
private static java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > ids ( final java.util.Collection < com.google.gerrit.client.reviewdb.AccountGroup > groupList ) { final java.util.HashSet < com.google.gerrit.client.reviewdb.AccountGroup.Id > r = new java.util.HashSet < com.google.gerrit.client.reviewdb.AccountGroup.Id > ( ) ; for ( final com.google.gerrit.client.reviewdb.AccountGroup group : groupList ) { r.add ( group.getId ( ) ) ; } return r ; }

Target:
private void assertAmGroupOwner ( final com.google.gerrit.client.reviewdb.ReviewDb db , final com.google.gerrit.client.reviewdb.AccountGroup group ) throws com.google.gerrit.server.rpc.Failure { try { if ( ! ( groupControlFactory.controlFor ( group.getId ( ) ) . isOwner ( ) ) ) { throw new com.google.gerrit.server.rpc.Failure ( new com.google.gerrit.server.account.NoSuchGroupException ( group.getId ( ) ) ) ; } } catch ( com.google.gerrit.server.account.NoSuchGroupException e ) { throw new com.google.gerrit.server.rpc.Failure ( new com.google.gerrit.server.account.NoSuchGroupException ( group.getId ( ) ) ) ; } }
Source:
public java.util.Collection < com.google.gerrit.common.data.AccessSection > getAllAccessSections ( ) { java.util.List < com.google.gerrit.common.data.AccessSection > all = new java.util.ArrayList < com.google.gerrit.common.data.AccessSection > ( ) ; all.addAll ( getLocalAccessSections ( ) ) ; all.addAll ( getInheritedAccessSections ( ) ) ; return all ; }

Target:
private java.util.List < com.google.gerrit.server.project.SectionMatcher > getLocalAccessSections ( ) { java.util.List < com.google.gerrit.server.project.SectionMatcher > sm = localAccessSections ; if ( sm == null ) { java.util.Collection < com.google.gerrit.common.data.AccessSection > fromConfig = config.getAccessSections ( ) ; sm = new java.util.ArrayList < com.google.gerrit.server.project.SectionMatcher > ( fromConfig.size ( ) ) ; for ( com.google.gerrit.common.data.AccessSection section : fromConfig ) { com.google.gerrit.server.project.SectionMatcher matcher = com.google.gerrit.server.project.SectionMatcher.wrap ( section ) ; if ( matcher != null ) { sm.add ( matcher ) ; } } localAccessSections = sm ; } return sm ; }
Source:
public static void assertProjectOwners ( java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > expectedOwners , com.google.gerrit.server.project.ProjectState state ) { for ( com.google.gerrit.reviewdb.client.AccountGroup.UUID g : state.getOwners ( ) ) { com.google.common.truth.Truth.assertThat ( expectedOwners.remove ( g ) ) . isTrue ( ) ; } com.google.common.truth.Truth.assertThat ( expectedOwners ) . isEmpty ( ) ; }

Target:
public static void assertProjectOwners ( java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > expectedOwners , com.google.gerrit.server.project.ProjectState state ) { for ( com.google.gerrit.reviewdb.client.AccountGroup.UUID g : state.getOwners ( ) ) { com.google.common.truth.Truth.assertThat ( expectedOwners.remove ( g ) ) . isTrue ( ) ; } com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < ? > ) ( expectedOwners ) ) ) . isEmpty ( ) ; }
Source:
public com.google.gerrit.server.project.ChildProjectResource parse ( com.google.gerrit.server.project.ProjectResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { com.google.gerrit.server.project.ProjectResource p = projectsCollection.parse ( TopLevelResource.INSTANCE , id ) ; for ( com.google.gerrit.server.project.ProjectState pp : p.getProjectState ( ) . parents ( ) ) { if ( parent.getNameKey ( ) . equals ( pp.getProject ( ) . getNameKey ( ) ) ) { return new com.google.gerrit.server.project.ChildProjectResource ( parent , p.getProjectState ( ) ) ; } } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; }

Target:
public com.google.gerrit.server.project.ChildProjectResource parse ( com.google.gerrit.server.project.ProjectResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { parent.getProjectState ( ) . checkStatePermitsRead ( ) ; com.google.gerrit.server.project.ProjectResource p = projectsCollection.parse ( TopLevelResource.INSTANCE , id ) ; for ( com.google.gerrit.server.project.ProjectState pp : p.getProjectState ( ) . parents ( ) ) { if ( parent.getNameKey ( ) . equals ( pp.getProject ( ) . getNameKey ( ) ) ) { return new com.google.gerrit.server.project.ChildProjectResource ( parent , p.getProjectState ( ) ) ; } } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; }
Source:
public java.lang.Iterable < com.google.gerrit.extensions.common.WebLinkInfo > getFileLinks ( java.lang.String project , java.lang.String revision , java.lang.String file ) { java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > links = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.extensions.webui.FileWebLink webLink : fileLinks ) { links.add ( new com.google.gerrit.extensions.common.WebLinkInfo ( webLink.getLinkName ( ) , webLink.getImageUrl ( ) , webLink.getFileUrl ( project , revision , file ) , webLink.getTarget ( ) ) ) ; } return links ; }

Target:
public java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > getFileLinks ( java.lang.String project , java.lang.String revision , java.lang.String file ) { java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > links = new java.util.ArrayList < > ( 4 ) ; for ( com.google.gerrit.extensions.webui.FileWebLink webLink : fileLinks ) { com.google.gerrit.extensions.common.WebLinkInfo info = webLink.getFileWebLink ( project , revision , file ) ; if ( ( ! ( com.google.common.base.Strings.isNullOrEmpty ( info.name ) ) ) && ( ! ( com.google.common.base.Strings.isNullOrEmpty ( info.url ) ) ) ) { links.add ( info ) ; } } return links ; }
Source:
public void testAppend_String ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.append ( ( ( java.lang.String ) ( null ) ) ) ) ; org.junit.Assert.assertEquals ( "" , b.asString ( ) ) ; org.junit.Assert.assertSame ( b , b.append ( "foo" ) ) ; org.junit.Assert.assertSame ( b , b.append ( "bar" ) ) ; org.junit.Assert.assertEquals ( "foobar" , b.asString ( ) ) ; }

Target:
public void testAppend_String ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.append ( ( ( java.lang.String ) ( null ) ) ) ) ; com.google.common.truth.Truth.assertThat ( b.asString ( ) ) . isEmpty ( ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.append ( "foo" ) ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.append ( "bar" ) ) ; com.google.common.truth.Truth.assertThat ( b.asString ( ) ) . isEqualTo ( "foobar" ) ; }
Source:
public com.google.gerrit.server.change.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 ( "Mark private" ) . setTitle ( "Mark change as private" ) . setVisible ( ( ( ( ! ( change.isPrivate ( ) ) ) && ( ( change.getStatus ( ) ) != ( Change.Status.MERGED ) ) ) && ( canSetPrivate ( rsrc ) ) ) ) ; }

Target:
private boolean canSetPrivate ( com.google.gerrit.server.change.ChangeResource rsrc ) { com.google.gerrit.server.permissions.PermissionBackend.WithUser user = permissionBackend.user ( rsrc.getUser ( ) ) ; return ( user.testOrFalse ( GlobalPermission.ADMINISTRATE_SERVER ) ) || ( ( rsrc.isUserOwner ( ) ) && ( ( rsrc.getChange ( ) . getStatus ( ) ) != ( Change.Status.MERGED ) ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { admin2 = accounts.admin2 ( ) ; com.google.gerrit.extensions.api.groups.GroupInput gi = new com.google.gerrit.extensions.api.groups.GroupInput ( ) ; gi.name = name ( "New-Group" ) ; gi.members = com.google.common.collect.ImmutableList.of ( user.id.toString ( ) ) ; newGroup = gApi.groups ( ) . create ( gi ) . get ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { anonRestSession = new com.google.gerrit.acceptance.RestSession ( server , null ) ; admin2 = accounts.admin2 ( ) ; com.google.gerrit.extensions.api.groups.GroupInput gi = new com.google.gerrit.extensions.api.groups.GroupInput ( ) ; gi.name = name ( "New-Group" ) ; gi.members = com.google.common.collect.ImmutableList.of ( user.id.toString ( ) ) ; newGroup = gApi.groups ( ) . create ( gi ) . get ( ) ; }
Source:
private void initProviderBouncyCastle ( org.eclipse.jgit.lib.Config cfg ) { setKeyExchangeFactories ( java.util.Arrays.< org.apache.sshd.common.NamedFactory < org.apache.sshd.common.KeyExchange > > asList ( new org.apache.sshd.server.kex.DHG14.Factory ( ) , new org.apache.sshd.server.kex.DHG1.Factory ( ) ) ) ; org.apache.sshd.common.NamedFactory < org.apache.sshd.common.Random > factory ; if ( cfg.getBoolean ( "sshd" , null , "testUseInsecureRandom" , false ) ) { factory = new com.google.gerrit.sshd.SshDaemon.InsecureBouncyCastleRandom.Factory ( ) ; } else { factory = new org.apache.sshd.common.random.BouncyCastleRandom.Factory ( ) ; } setRandomFactory ( new org.apache.sshd.common.random.SingletonRandomFactory ( factory ) ) ; }

Target:
private void initProviderBouncyCastle ( org.eclipse.jgit.lib.Config cfg ) { org.apache.sshd.common.NamedFactory < org.apache.sshd.common.random.Random > factory ; if ( cfg.getBoolean ( "sshd" , null , "testUseInsecureRandom" , false ) ) { factory = new com.google.gerrit.sshd.SshDaemon.InsecureBouncyCastleRandom.Factory ( ) ; } else { factory = org.apache.sshd.common.util.SecurityUtils.getRandomFactory ( ) ; } setRandomFactory ( new org.apache.sshd.common.random.SingletonRandomFactory ( factory ) ) ; }
Source:
public void testThreeLevelTreeWithSomeIndexPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "-foo:a (file:b OR file:c)" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; com.google.common.truth.Truth.assertThat ( out.getClass ( ) ) . isSameAs ( com.google.gerrit.server.query.change.AndSource.class ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( in.getChild ( 1 ) ) , in.getChild ( 0 ) ) . inOrder ( ) ; }

Target:
public void testThreeLevelTreeWithSomeIndexPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "-foo:a (file:b OR file:c)" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; com.google.common.truth.Truth.assertThat ( out.getClass ( ) ) . isSameAs ( com.google.gerrit.server.query.change.AndChangeSource.class ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( in.getChild ( 1 ) ) , in.getChild ( 0 ) ) . inOrder ( ) ; }
Source:
public com.google.gerrit.common.data.Capable canPushToAtLeastOneRef ( ) { if ( ( ! ( canPerformOnAnyRef ( Permission.PUSH ) ) ) && ( ! ( canPerformOnAnyRef ( Permission.CREATE_TAG ) ) ) ) { java.lang.String pName = state.getProject ( ) . getName ( ) ; return new com.google.gerrit.common.data.Capable ( ( ( "Upload denied for project '" + pName ) + "'" ) ) ; } if ( state.isUseContributorAgreements ( ) ) { return verifyActiveContributorAgreement ( ) ; } return com.google.gerrit.common.data.Capable.OK ; }

Target:
public com.google.gerrit.common.data.Capable canPushToAtLeastOneRef ( ) { if ( ( ( ! ( canPerformOnAnyRef ( Permission.PUSH ) ) ) && ( ! ( canPerformOnAnyRef ( Permission.CREATE_TAG ) ) ) ) && ( ! ( isOwner ( ) ) ) ) { java.lang.String pName = state.getProject ( ) . getName ( ) ; return new com.google.gerrit.common.data.Capable ( ( ( "Upload denied for project '" + pName ) + "'" ) ) ; } if ( state.isUseContributorAgreements ( ) ) { return verifyActiveContributorAgreement ( ) ; } return com.google.gerrit.common.data.Capable.OK ; }
Source:
public void onShowView ( ) { super . onShowView ( ) ; java.lang.String prior = com.google.gerrit.client.Gerrit.getPriorView ( ) ; if ( ( prior != null ) && ( prior.startsWith ( "/c/" ) ) ) { scrollToPath ( prior.substring ( 3 ) ) ; } }

Target:
public void onShowView ( ) { super . onShowView ( ) ; java.lang.String prior = com.google.gerrit.client.Gerrit.getPriorView ( ) ; if ( ( prior != null ) && ( prior.startsWith ( "/c/" ) ) ) { scrollToPath ( prior.substring ( 3 ) ) ; } startPoller ( ) ; }