auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void noRescheduleOnNonRecoverableException ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( org.mockito.ArgumentMatchers.eq ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.WEBHOOK_URL ) , org.mockito.ArgumentMatchers.eq ( content ) ) ) . thenThrow ( javax.net.ssl.SSLException.class ) ; task.run ( ) ; org.mockito.Mockito.verifyZeroInteractions ( executor ) ; }

Target:
public void noRescheduleOnNonRecoverableException ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( org.mockito.ArgumentMatchers.eq ( remote ) , org.mockito.ArgumentMatchers.eq ( content ) ) ) . thenThrow ( javax.net.ssl.SSLException.class ) ; task.run ( ) ; org.mockito.Mockito.verifyZeroInteractions ( executor ) ; }
Source:
private com.google.gerrit.server.data.PatchSetAttribute asPatchSetAttribute ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet patchSet , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( change.getProject ( ) ) ; org.eclipse.jgit.revwalk.RevWalk revWalk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return eventFactory.asPatchSetAttribute ( db , revWalk , patchSet ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }

Target:
public com.google.gerrit.server.data.PatchSetAttribute get ( ) { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( change.getProject ( ) ) ; org.eclipse.jgit.revwalk.RevWalk revWalk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return eventFactory.asPatchSetAttribute ( revWalk , change , patchSet ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } }
Source:
public void setLimit ( int n ) { queryProcessor.setLimit ( n ) ; if ( n < 0 ) { suggestLimit = 10 ; } else if ( n == 0 ) { suggestLimit = com.google.gerrit.server.account.QueryAccounts.MAX_SUGGEST_RESULTS ; } else { suggestLimit = java.lang.Math.min ( n , com.google.gerrit.server.account.QueryAccounts.MAX_SUGGEST_RESULTS ) ; } }

Target:
public void setLimit ( int n ) { queryProcessor.setUserProvidedLimit ( n ) ; if ( n < 0 ) { suggestLimit = 10 ; } else if ( n == 0 ) { suggestLimit = com.google.gerrit.server.account.QueryAccounts.MAX_SUGGEST_RESULTS ; } else { suggestLimit = java.lang.Math.min ( n , com.google.gerrit.server.account.QueryAccounts.MAX_SUGGEST_RESULTS ) ; } }
Source:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.Index.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException { permissionBackend.user ( user ) . check ( GlobalPermission.MAINTAIN_SERVER ) ; indexer.index ( db.get ( ) , rsrc.getChange ( ) ) ; return com.google.gerrit.extensions.restapi.Response.none ( ) ; }

Target:
protected com.google.gerrit.extensions.restapi.Response < ? > applyImpl ( com.google.gerrit.server.update.BatchUpdate.Factory updateFactory , com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.Index.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException { permissionBackend.user ( user ) . check ( GlobalPermission.MAINTAIN_SERVER ) ; indexer.index ( db.get ( ) , rsrc.getChange ( ) ) ; return com.google.gerrit.extensions.restapi.Response.none ( ) ; }
Source:
private com.google.gerrit.reviewdb.client.Change retrieveChange ( java.lang.String ref , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet.Id id = PatchSet.Id.fromRef ( ref ) ; com.google.gerrit.reviewdb.client.Change change = db.changes ( ) . get ( id.getParentKey ( ) ) ; return change ; }

Target:
private com.google.gerrit.reviewdb.client.Change retrieveChange ( java.lang.String project , java.lang.String ref , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet.Id id = PatchSet.Id.fromRef ( ref ) ; return notesFactory.create ( db , new com.google.gerrit.reviewdb.client.Project.NameKey ( project ) , id.getParentKey ( ) ) . getChange ( ) ; }
Source:
public com.google.gerrit.extensions.api.changes.RevisionReviewerApi reviewer ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return revisionReviewerApi.create ( revisionReviewers.parse ( revision , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( id ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot parse reviewer" , e ) ; } }

Target:
public com.google.gerrit.extensions.api.changes.RevisionReviewerApi reviewer ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return revisionReviewerApi.create ( revisionReviewers.parse ( revision , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( id ) ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot parse reviewer" , e ) ; } }
Source:
public com.google.gerrit.server.account.GroupMembership membershipsOf ( com.google.gerrit.server.IdentifiedUser user ) { java.lang.String id = com.google.gerrit.server.auth.ldap.LdapGroupBackend.findId ( user.state ( ) . getExternalIds ( ) ) ; if ( id == null ) { return com.google.gerrit.server.account.GroupMembership.EMPTY ; } return new com.google.gerrit.server.account.ListGroupMembership ( membershipCache.get ( id ) ) ; }

Target:
public com.google.gerrit.server.account.GroupMembership membershipsOf ( com.google.gerrit.server.IdentifiedUser user ) { java.lang.String id = com.google.gerrit.server.auth.ldap.LdapGroupBackend.findId ( user.state ( ) . getExternalIds ( ) ) ; if ( id == null ) { return com.google.gerrit.server.account.GroupMembership.EMPTY ; } try { return new com.google.gerrit.server.account.ListGroupMembership ( membershipCache.get ( id ) ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.auth.ldap.LdapGroupBackend.log.warn ( java.lang.String.format ( "Cannot lookup membershipsOf %s in LDAP" , id ) , e ) ; return com.google.gerrit.server.account.GroupMembership.EMPTY ; } }
Source:
static org.eclipse.jgit.lib.Config parse ( com.google.gerrit.acceptance.GerritConfig annotation ) { org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; com.google.gerrit.acceptance.ConfigAnnotationParser.parse ( cfg , annotation ) ; return cfg ; }

Target:
static org.eclipse.jgit.lib.Config parseFromSystemProperty ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; java.lang.String name = java.lang.System.getProperty ( ( ( com.google.gerrit.acceptance.ConfigAnnotationParser.CONFIG_PKG ) + "BaseConfig" ) ) ; if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( name ) ) ) { java.lang.String resource = ( ( com.google.gerrit.acceptance.ConfigAnnotationParser.CONFIG_DIR ) + name ) + ".config" ; java.net.URL url = com.google.common.base.Preconditions.checkNotNull ( com.google.gerrit.acceptance.ConfigAnnotationParser.class . getResource ( resource ) , "test config resource not found: %s" , resource ) ; cfg.fromText ( com.google.common.io.Resources.toString ( url , com.google.common.base.Charsets.UTF_8 ) ) ; } return cfg ; }
Source:
public void usernamePatternWithRegex ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "^refs/sb/${username}/heads/.*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , "d.v" , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = user ( local , "dev" , com.google.gerrit.server.project.Util.DEVS ) ; assertCannotRead ( "refs/sb/dev/heads/foobar" , u ) ; assertCanRead ( "refs/sb/dev/heads/foobar" , d ) ; }

Target:
public void usernameEmailPatternWithRegex ( ) { com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.testing.Util.DEVS , "^refs/sb/${username}/heads/.*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , "d.v@ger-rit.org" , com.google.gerrit.server.project.testing.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = user ( local , "dev@ger-rit.org" , com.google.gerrit.server.project.testing.Util.DEVS ) ; assertCannotRead ( "refs/sb/dev@ger-rit.org/heads/foobar" , u ) ; assertCanRead ( "refs/sb/dev@ger-rit.org/heads/foobar" , d ) ; }
Source:
public Account.Id lookup ( java.lang.String accountName ) { try { com.google.common.base.Optional < com.google.gerrit.reviewdb.client.Account.Id > id = usernameCache.get ( accountName ) ; return id != null ? id.orNull ( ) : null ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.auth.ldap.LdapRealm.log.warn ( java.lang.String.format ( "Cannot lookup account %s in LDAP" , accountName ) , e ) ; return null ; } }

Target:
public Account.Id lookup ( java.lang.String accountName ) { if ( com.google.common.base.Strings.isNullOrEmpty ( accountName ) ) { return null ; } try { com.google.common.base.Optional < com.google.gerrit.reviewdb.client.Account.Id > id = usernameCache.get ( accountName ) ; return id != null ? id.orNull ( ) : null ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.auth.ldap.LdapRealm.log.warn ( java.lang.String.format ( "Cannot lookup account %s in LDAP" , accountName ) , e ) ; return null ; } }
Source:
void display ( final java.util.List < com.google.gerrit.client.account.AccountProjectWatchInfo > result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.client.account.AccountProjectWatchInfo k : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; populate ( row , k ) ; } }

Target:
void display ( final java.util.List < com.google.gerrit.client.account.AccountProjectWatchInfo > result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.client.account.AccountProjectWatchInfo k : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , k ) ; } }
Source:
private java.util.Set < java.lang.String > getManifestProjects ( java.lang.String fromBranch ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException { java.util.Map fromBranchConfig = config.getMergeConfig ( fromBranch ) ; java.util.Map < java.lang.String , java.lang.String > manifestProjectInfo = getManifestInfoFromConfig ( fromBranchConfig ) ; return getManifestProjectsForBranch ( manifestProjectInfo , fromBranch ) ; }

Target:
private java.util.Set < java.lang.String > getManifestProjects ( java.lang.String fromBranch ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException { java.util.Map fromBranchConfig = config.getMergeConfig ( fromBranch ) ; if ( fromBranchConfig == null ) { return new java.util.HashSet < > ( ) ; } java.util.Map < java.lang.String , java.lang.String > manifestProjectInfo = getManifestInfoFromConfig ( fromBranchConfig ) ; return getManifestProjectsForBranch ( manifestProjectInfo , fromBranch ) ; }
Source:
private void load ( ) throws java.io.IOException { close ( ) ; reader = repo.newObjectReader ( ) ; org.eclipse.jgit.lib.Ref ref = repo.getRefDatabase ( ) . exactRef ( RefNames.REFS_GPG_KEYS ) ; if ( ref == null ) { return ; } try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( reader ) ) { notes = org.eclipse.jgit.notes.NoteMap.read ( reader , rw.parseCommit ( ref.getObjectId ( ) ) ) ; } }

Target:
private void load ( ) throws java.io.IOException { close ( ) ; reader = repo.newObjectReader ( ) ; org.eclipse.jgit.lib.Ref ref = repo.getRefDatabase ( ) . exactRef ( RefNames.REFS_GPG_KEYS ) ; if ( ref == null ) { return ; } try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( reader ) ) { tip = rw.parseCommit ( ref.getObjectId ( ) ) ; notes = org.eclipse.jgit.notes.NoteMap.read ( reader , tip ) ; } }
Source:
static com.google.gwtorm.server.ResultSet < com.google.gerrit.server.query.change.ChangeData > patchSetApproval ( final com.google.gwtorm.server.ResultSet < com.google.gerrit.reviewdb.client.PatchSetApproval > rs ) { return new com.google.gerrit.server.query.change.ChangeDataResultSet < com.google.gerrit.reviewdb.client.PatchSetApproval > ( rs , false ) { @ java.lang.Override com.google.gerrit.server.query.change.ChangeData convert ( com.google.gerrit.reviewdb.client.PatchSetApproval t ) { return new com.google.gerrit.server.query.change.ChangeData ( t.getPatchSetId ( ) . getParentKey ( ) ) ; } } ; }

Target:
static com.google.gwtorm.server.ResultSet < com.google.gerrit.server.query.change.ChangeData > patchSet ( final com.google.gerrit.server.query.change.ChangeData.Factory factory , final com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > db , final com.google.gwtorm.server.ResultSet < com.google.gerrit.reviewdb.client.PatchSet > rs ) { return new com.google.gerrit.server.query.change.ChangeDataResultSet < com.google.gerrit.reviewdb.client.PatchSet > ( rs , false ) { @ java.lang.Override com.google.gerrit.server.query.change.ChangeData convert ( com.google.gerrit.reviewdb.client.PatchSet t ) { return factory.create ( db.get ( ) , t.getId ( ) . getParentKey ( ) ) ; } } ; }
Source:
private void addDiffChunkAndPadding ( net.codemirror.lib.CodeMirror cmToPad , int lineToPad , int lineOnOther , int chunkSize , boolean edit ) { net.codemirror.lib.CodeMirror otherCm = otherCm ( cmToPad ) ; linePaddingOnOtherSideMap.put ( otherCm.getLineHandle ( lineOnOther ) , new com.google.gerrit.client.diff.PaddingManager.LinePaddingWidgetWrapper ( addPaddingWidget ( cmToPad , DiffTable.style.padding ( ) , lineToPad , 0 , Unit.EM , null ) , lineToPad , chunkSize ) ) ; diffChunks.add ( new com.google.gerrit.client.diff.SideBySide2.DiffChunkInfo ( getSideFromCm ( otherCm ) , ( ( lineOnOther - chunkSize ) + 1 ) , lineOnOther , edit ) ) ; }

Target:
private void addDiffChunkAndPadding ( net.codemirror.lib.CodeMirror cmToPad , int lineToPad , int lineOnOther , int chunkSize , boolean edit ) { net.codemirror.lib.CodeMirror otherCm = otherCm ( cmToPad ) ; linePaddingOnOtherSideMap.put ( otherCm.getLineHandle ( lineOnOther ) , new com.google.gerrit.client.diff.PaddingManager.LinePaddingWidgetWrapper ( addPaddingWidget ( cmToPad , DiffTable.style.padding ( ) , lineToPad , 0 , Unit.EM , null ) , lineToPad , chunkSize ) ) ; diffChunks.add ( new com.google.gerrit.client.diff.DiffChunkInfo ( getSideFromCm ( otherCm ) , ( ( lineOnOther - chunkSize ) + 1 ) , lineOnOther , edit ) ) ; }
Source:
void onSave ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { com.google.gerrit.client.changes.ChangeFileApi.putContentOrMessage ( revision , path , cm.getValue ( ) , new com.google.gerrit.client.rpc.GerritCallback < 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.toChangeInEditMode ( revision.getParentKey ( ) ) ) ; } } ) ; }

Target:
void setShowWhitespaceErrors ( final boolean show ) { cm.operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { cm.setOption ( "showTrailingSpace" , show ) ; } } ) ; }
Source:
public void rejectWhenFeatureIsDisabled ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isTrue ( ) ; com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; cfg.setEnableReviewerByEmail ( false ) ; saveProjectConfig ( project , cfg ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; exception.expect ( com.google.gerrit.extensions.restapi.UnprocessableEntityException.class ) ; exception.expectMessage ( ( "Foo Bar <foo.bar@gerritcodereview.com> " + "does not identify a registered user or group" ) ) ; gApi.changes ( ) . id ( r.getChangeId ( ) ) . addReviewer ( "Foo Bar <foo.bar@gerritcodereview.com>" ) ; }

Target:
public void reviewersByEmailAreServedFromIndex ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isTrue ( ) ; com.google.gerrit.extensions.common.AccountInfo acc = new com.google.gerrit.extensions.common.AccountInfo ( "Foo Bar" , "foo.bar@gerritcodereview.com" ) ; for ( com.google.gerrit.extensions.client.ReviewerState state : com.google.common.collect.ImmutableList.of ( ReviewerState.CC , ReviewerState.REVIEWER ) ) { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.api.changes.AddReviewerInput input = new com.google.gerrit.extensions.api.changes.AddReviewerInput ( ) ; input.reviewer = com.google.gerrit.acceptance.rest.change.ChangeReviewersByEmailIT.toRfcAddressString ( acc ) ; input.state = state ; gApi.changes ( ) . id ( r.getChangeId ( ) ) . addReviewer ( input ) ; notesMigration.setFailOnLoad ( true ) ; try { com.google.gerrit.extensions.common.ChangeInfo info = com.google.common.collect.Iterables.getOnlyElement ( gApi.changes ( ) . query ( r.getChangeId ( ) ) . withOption ( ListChangesOption.DETAILED_LABELS ) . get ( ) ) ; com.google.common.truth.Truth.assertThat ( info.reviewers ) . isEqualTo ( com.google.common.collect.ImmutableMap.of ( state , com.google.common.collect.ImmutableList.of ( acc ) ) ) ; } finally { notesMigration.setFailOnLoad ( false ) ; } } }
Source:
public com.google.gerrit.server.plugins.PluginResource parse ( com.google.gerrit.extensions.restapi.TopLevelResource parent , java.lang.String id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.lang.Exception { com.google.gerrit.server.plugins.Plugin p = loader.get ( com.google.gerrit.extensions.restapi.Url.decode ( id ) ) ; if ( p == null ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } return new com.google.gerrit.server.plugins.PluginResource ( p ) ; }

Target:
public com.google.gerrit.server.plugins.PluginResource parse ( com.google.gerrit.extensions.restapi.TopLevelResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { com.google.gerrit.server.plugins.Plugin p = loader.get ( id.get ( ) ) ; if ( p == null ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } return new com.google.gerrit.server.plugins.PluginResource ( p ) ; }
Source:
private void display ( final com.google.gerrit.client.data.ChangeDetail detail ) { if ( ( changeInfo ) == null ) { displayTitle ( detail.getChange ( ) . getSubject ( ) ) ; } description.setText ( detail.getDescription ( ) ) ; descriptionPanel.setOpen ( true ) ; }

Target:
private void display ( final com.google.gerrit.client.data.ChangeDetail detail ) { if ( ( changeInfo ) == null ) { displayTitle ( detail.getChange ( ) . getSubject ( ) ) ; } description.setText ( detail.getDescription ( ) ) ; approvals.display ( detail.getApprovals ( ) ) ; descriptionPanel.setOpen ( true ) ; approvalsPanel.setOpen ( true ) ; }
Source:
private com.google.gerrit.reviewdb.client.Account loadAccount ( com.google.gerrit.reviewdb.client.Account.Id accountId , org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.lib.ObjectId commit ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { rw.reset ( ) ; com.google.gerrit.server.account.AccountConfig accountConfig = new com.google.gerrit.server.account.AccountConfig ( null , accountId ) ; accountConfig.load ( rw , commit ) ; return accountConfig.getAccount ( ) ; }

Target:
private java.util.Optional < com.google.gerrit.reviewdb.client.Account > loadAccount ( com.google.gerrit.reviewdb.client.Account.Id accountId , org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.lib.ObjectId commit ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { rw.reset ( ) ; com.google.gerrit.server.account.AccountConfig accountConfig = new com.google.gerrit.server.account.AccountConfig ( null , accountId ) ; accountConfig.load ( rw , commit ) ; return accountConfig.getLoadedAccount ( ) ; }
Source:
private com.google.gerrit.server.git.strategy.SubmitStrategy createStrategy ( com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.server.git.CodeReviewCommit branchTip ) throws com.google.gerrit.server.git.MergeException , com.google.gerrit.server.project.NoSuchProjectException { return submitStrategyFactory.create ( submitType , db , repo , rw , inserter , canMergeFlag , getAlreadyAccepted ( branchTip ) , destBranch ) ; }

Target:
private com.google.gerrit.server.git.strategy.SubmitStrategy createStrategy ( com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.server.git.CodeReviewCommit branchTip , com.google.gerrit.server.IdentifiedUser caller ) throws com.google.gerrit.server.git.MergeException , com.google.gerrit.server.project.NoSuchProjectException { return submitStrategyFactory.create ( submitType , db , repo , rw , inserter , canMergeFlag , getAlreadyAccepted ( branchTip ) , destBranch , caller ) ; }
Source:
private void disableLuceneAutomaticCommit ( ) { org.eclipse.jgit.lib.Config cfg = dbInjector.getInstance ( com.google.inject.Key.get ( org.eclipse.jgit.lib.Config.class , com.google.gerrit.server.config.GerritServerConfig.class ) ) ; if ( ( com.google.gerrit.server.index.IndexModule.getIndexType ( dbInjector ) ) == ( com.google.gerrit.server.index.IndexModule.IndexType.LUCENE ) ) { cfg.setLong ( "index" , "changes_open" , "commitWithin" , ( - 1 ) ) ; cfg.setLong ( "index" , "changes_closed" , "commitWithin" , ( - 1 ) ) ; } }

Target:
private void checkNotSlaveMode ( ) throws com.google.gerrit.common.Die { if ( globalConfig.getBoolean ( "container" , "slave" , false ) ) { throw die ( "Cannot run reindex in slave mode" ) ; } }
Source:
private void writeObject ( final java.io.ObjectOutputStream out ) throws java.io.IOException { org.eclipse.jgit.lib.ObjectIdSerialization.writeCanBeNull ( out , oldId ) ; org.eclipse.jgit.lib.ObjectIdSerialization.writeNotNull ( out , newId ) ; com.google.gerrit.server.ioutil.BasicSerialization.writeEnum ( out , whitespace ) ; }

Target:
private void writeObject ( final java.io.ObjectOutputStream out ) throws java.io.IOException { org.eclipse.jgit.lib.ObjectIdSerialization.writeCanBeNull ( out , oldId ) ; org.eclipse.jgit.lib.ObjectIdSerialization.writeNotNull ( out , newId ) ; java.lang.Character c = com.google.gerrit.server.patch.PatchListKey.WHITESPACE_TYPES.get ( whitespace ) ; if ( c == null ) { throw new java.io.IOException ( ( "Invalid whitespace type: " + ( whitespace ) ) ) ; } out.writeChar ( c ) ; }
Source:
protected void initColumnHeaders ( ) { super . initColumnHeaders ( ) ; table.setText ( 0 , ProjectsTable.C_REPO_BROWSER , Util.C.projectRepoBrowser ( ) ) ; table.getFlexCellFormatter ( ) . addStyleName ( 0 , ProjectsTable.C_REPO_BROWSER , Gerrit.RESOURCES.css ( ) . dataHeader ( ) ) ; }

Target:
protected void initColumnHeaders ( ) { super . initColumnHeaders ( ) ; table.setText ( 0 , ProjectsTable.C_REPO_BROWSER , AdminConstants.I.projectRepoBrowser ( ) ) ; table.getFlexCellFormatter ( ) . addStyleName ( 0 , ProjectsTable.C_REPO_BROWSER , Gerrit.RESOURCES.css ( ) . dataHeader ( ) ) ; }
Source:
public java.util.List < com.google.gerrit.extensions.common.ChangeInfo > submittedTogether ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return submittedTogether.apply ( change ) ; } catch ( java.lang.Exception e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot query submittedTogether" , e ) ; } }

Target:
public java.util.List < com.google.gerrit.extensions.common.ChangeInfo > submittedTogether ( java.util.EnumSet < com.google.gerrit.extensions.client.SubmittedTogetherOption > s ) throws com.google.gerrit.extensions.restapi.RestApiException { try { for ( com.google.gerrit.extensions.client.SubmittedTogetherOption o : s ) { submittedTogether.addOption ( o ) ; } return submittedTogether.apply ( change ) ; } catch ( java.lang.Exception e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot query submittedTogether" , e ) ; } }
Source:
protected void configure ( ) { bindScope ( com.google.inject.servlet.SessionScoped.class , SshScopes.SESSION ) ; bindScope ( com.google.inject.servlet.RequestScoped.class , SshScopes.REQUEST ) ; configureSessionScope ( ) ; configureRequestScope ( ) ; bind ( com.google.gerrit.server.ssh.Sshd.class ) . to ( com.google.gerrit.server.ssh.GerritSshDaemon.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( org.apache.sshd.server.CommandFactory.class ) . toProvider ( com.google.gerrit.server.ssh.CommandFactoryProvider.class ) ; bind ( org.apache.sshd.server.PublickeyAuthenticator.class ) . to ( com.google.gerrit.server.ssh.DatabasePubKeyAuth.class ) ; install ( new com.google.gerrit.server.ssh.commands.DefaultCommandModule ( ) ) ; }

Target:
protected void configure ( ) { bindScope ( com.google.inject.servlet.SessionScoped.class , SshScopes.SESSION ) ; bindScope ( com.google.inject.servlet.RequestScoped.class , SshScopes.REQUEST ) ; configureSessionScope ( ) ; configureRequestScope ( ) ; bind ( com.google.gerrit.server.ssh.SshInfo.class ) . to ( com.google.gerrit.server.ssh.SshDaemon.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( org.apache.sshd.server.CommandFactory.class ) . toProvider ( com.google.gerrit.server.ssh.CommandFactoryProvider.class ) ; bind ( org.apache.sshd.server.PublickeyAuthenticator.class ) . to ( com.google.gerrit.server.ssh.DatabasePubKeyAuth.class ) ; install ( new com.google.gerrit.server.ssh.commands.DefaultCommandModule ( ) ) ; }
Source:
public void setRegisterKeys ( boolean on ) { if ( on && ( isAttached ( ) ) ) { if ( ( regNavigation ) == null ) { regNavigation = com.google.gwtexpui.globalkey.client.GlobalKey.add ( this , keysNavigation ) ; } } else if ( ( regNavigation ) != null ) { regNavigation.removeHandler ( ) ; regNavigation = null ; } }

Target:
public void setRegisterKeys ( boolean on ) { if ( on && ( isAttached ( ) ) ) { if ( ( regNavigation ) == null ) { regNavigation = com.google.gwtexpui.globalkey.client.GlobalKey.add ( this , keysNavigation ) ; } if ( view.ensureRowMeasurements ( ) ) { view.movePointerTo ( view.selectedRow , true ) ; } } else if ( ( regNavigation ) != null ) { regNavigation.removeHandler ( ) ; regNavigation = null ; } }
Source:
public com.google.gwtjsonrpc.client.VoidResult run ( final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gerrit.httpd.rpc.account.Failure , com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; assertAmGroupOwner ( db , group ) ; group.setExternalNameKey ( bindTo ) ; db.accountGroups ( ) . update ( java.util.Collections.singleton ( group ) ) ; groupCache.evict ( group ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }

Target:
public com.google.gwtjsonrpc.common.VoidResult run ( final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gerrit.httpd.rpc.account.Failure , com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; assertAmGroupOwner ( db , group ) ; group.setExternalNameKey ( bindTo ) ; db.accountGroups ( ) . update ( java.util.Collections.singleton ( group ) ) ; groupCache.evict ( group ) ; return com.google.gwtjsonrpc.common.VoidResult.INSTANCE ; }
Source:
private com.google.gerrit.server.ssh.AbstractCommand create ( final java.lang.String cmd ) { final com.google.gerrit.server.ssh.GerritCommandFactory.Factory f = commands.get ( cmd ) ; if ( f != null ) { return f.create ( ) ; } return new com.google.gerrit.server.ssh.AbstractCommand ( ) { @ java.lang.Override protected void run ( ) throws com.google.gerrit.server.ssh.Failure { throw new com.google.gerrit.server.ssh.UnloggedFailure ( 127 , ( ( "gerrit: " + ( getName ( ) ) ) + ": not found" ) ) ; } } ; }

Target:
private com.google.gerrit.server.ssh.AbstractCommand create ( final java.lang.String cmd ) { final com.google.inject.Provider < ? extends com.google.gerrit.server.ssh.AbstractCommand > f = commands.get ( cmd ) ; if ( f != null ) { return f.get ( ) ; } return new com.google.gerrit.server.ssh.AbstractCommand ( ) { @ java.lang.Override protected void run ( ) throws com.google.gerrit.server.ssh.Failure { throw new com.google.gerrit.server.ssh.UnloggedFailure ( 127 , ( ( "gerrit: " + ( getName ( ) ) ) + ": not found" ) ) ; } } ; }
Source:
private static boolean isBlankLineGap ( com.google.gerrit.server.patch.Text a , int b , int e ) { for ( ; b < e ; b ++ ) { if ( ! ( com.google.gerrit.server.patch.PatchListCacheImpl.BLANK_LINE_RE.matcher ( a.getLine ( b ) ) . matches ( ) ) ) { return false ; } } return true ; }

Target:
private static boolean isBlankLineGap ( com.google.gerrit.server.patch.Text a , int b , int e ) { for ( ; b < e ; b ++ ) { if ( ! ( com.google.gerrit.server.patch.PatchListCacheImpl.BLANK_LINE_RE.matcher ( a.getString ( b ) ) . matches ( ) ) ) { return false ; } } return true ; }
Source:
private org.asciidoctor.Options createOptions ( java.io.File outputFile ) { org.asciidoctor.OptionsBuilder optionsBuilder = org.asciidoctor.OptionsBuilder.options ( ) ; optionsBuilder.backend ( backend ) . docType ( AsciiDoctor.DOCTYPE ) . eruby ( AsciiDoctor.ERUBY ) . safe ( SafeMode.UNSAFE ) ; optionsBuilder.toFile ( outputFile ) ; org.asciidoctor.AttributesBuilder attributesBuilder = org.asciidoctor.AttributesBuilder.attributes ( ) ; attributesBuilder.attributes ( getAttributes ( ) ) ; optionsBuilder.attributes ( attributesBuilder.get ( ) ) ; return optionsBuilder.get ( ) ; }

Target:
private org.asciidoctor.Options createOptions ( java.io.File outputFile ) { org.asciidoctor.OptionsBuilder optionsBuilder = org.asciidoctor.OptionsBuilder.options ( ) ; optionsBuilder.backend ( backend ) . docType ( AsciiDoctor.DOCTYPE ) . eruby ( AsciiDoctor.ERUBY ) . safe ( SafeMode.UNSAFE ) . baseDir ( basedir ) ; optionsBuilder.toFile ( outputFile ) ; org.asciidoctor.AttributesBuilder attributesBuilder = org.asciidoctor.AttributesBuilder.attributes ( ) ; attributesBuilder.attributes ( getAttributes ( ) ) ; optionsBuilder.attributes ( attributesBuilder.get ( ) ) ; return optionsBuilder.get ( ) ; }
Source:
private void add ( com.google.gerrit.reviewdb.server.ReviewDb db , java.util.List < com.google.gerrit.sshd.SshKeyCacheEntry > kl , com.google.gerrit.reviewdb.client.AccountSshKey k ) { try { kl.add ( new com.google.gerrit.sshd.SshKeyCacheEntry ( k.getKey ( ) , com.google.gerrit.sshd.SshUtil.parse ( k ) ) ) ; } catch ( java.lang.OutOfMemoryError e ) { throw e ; } catch ( java.lang.Throwable e ) { markInvalid ( db , k ) ; } }

Target:
private void markInvalid ( com.google.gerrit.reviewdb.client.AccountSshKey k ) { try { com.google.gerrit.sshd.SshKeyCacheImpl.log.info ( ( ( "Flagging SSH key " + ( k.getKey ( ) ) ) + " invalid" ) ) ; authorizedKeys.markKeyInvalid ( k.getAccount ( ) , k.getKey ( ) . get ( ) ) ; k.setInvalid ( ) ; } catch ( java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException e ) { com.google.gerrit.sshd.SshKeyCacheImpl.log.error ( ( ( "Failed to mark SSH key" + ( k.getKey ( ) ) ) + " invalid" ) , e ) ; } }
Source:
public int compare ( com.google.gerrit.server.notedb.ChangeRebuilder.Event a , com.google.gerrit.server.notedb.ChangeRebuilder.Event b ) { return com.google.common.collect.ComparisonChain.start ( ) . compare ( a.when , b.when ) . compare ( a.who.get ( ) , b.who.get ( ) ) . compare ( a.psId.get ( ) , b.psId.get ( ) ) . result ( ) ; }

Target:
public int compare ( com.google.gerrit.server.notedb.ChangeRebuilder.Event a , com.google.gerrit.server.notedb.ChangeRebuilder.Event b ) { return com.google.common.collect.ComparisonChain.start ( ) . compareTrueFirst ( a.predatesChange , b.predatesChange ) . compare ( a.when , b.when ) . compare ( a.who.get ( ) , b.who.get ( ) ) . compare ( a.psId.get ( ) , b.psId.get ( ) ) . result ( ) ; }
Source:
private void testGetGroup ( java.lang.String url , com.google.gerrit.reviewdb.client.AccountGroup expectedGroup ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = session.get ( url ) ; @ java.lang.SuppressWarnings ( value = "serial" ) com.google.gerrit.acceptance.rest.group.GroupInfo group = new com.google.gson.Gson ( ) . fromJson ( r.getReader ( ) , new com.google.common.reflect.TypeToken < com.google.gerrit.acceptance.rest.group.GroupInfo > ( ) { } . getType ( ) ) ; com.google.gerrit.acceptance.rest.group.GroupAssert.assertGroupInfo ( expectedGroup , group ) ; }

Target:
private void testGetGroup ( java.lang.String url , com.google.gerrit.reviewdb.client.AccountGroup expectedGroup ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = session.get ( url ) ; com.google.gerrit.acceptance.rest.group.GroupInfo group = new com.google.gson.Gson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < com.google.gerrit.acceptance.rest.group.GroupInfo > ( ) { } . getType ( ) ) ; com.google.gerrit.acceptance.rest.group.GroupAssert.assertGroupInfo ( expectedGroup , group ) ; }
Source:
public void canReadCommitWhenAllRefsVisible ( ) throws java.lang.Exception { allow ( project , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; org.eclipse.jgit.lib.ObjectId id = repo.branch ( "master" ) . commit ( ) . create ( ) ; com.google.gerrit.server.project.ProjectControl pc = newProjectControl ( ) ; org.eclipse.jgit.revwalk.RevWalk rw = repo.getRevWalk ( ) ; org.eclipse.jgit.lib.Repository r = repo.getRepository ( ) ; org.junit.Assert.assertTrue ( pc.canReadCommit ( db , r , rw.parseCommit ( id ) ) ) ; }

Target:
public void canReadCommitWhenAllRefsVisible ( ) throws java.lang.Exception { allow ( project , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; org.eclipse.jgit.lib.ObjectId id = repo.branch ( "master" ) . commit ( ) . create ( ) ; com.google.gerrit.server.project.ProjectState state = readProjectState ( ) ; org.eclipse.jgit.revwalk.RevWalk rw = repo.getRevWalk ( ) ; org.eclipse.jgit.lib.Repository r = repo.getRepository ( ) ; org.junit.Assert.assertTrue ( commits.canRead ( state , r , rw.parseCommit ( id ) ) ) ; }
Source:
public com.google.gerrit.client.ui.InlineHyperlink getPreviousPatchLink ( int index , com.google.gerrit.client.patches.PatchScreen.Type patchType ) { for ( index -- ; index > ( - 1 ) ; index -- ) { com.google.gerrit.client.ui.InlineHyperlink link = createLink ( index , patchType , com.google.gwtexpui.safehtml.client.SafeHtml.asis ( Util.C.prevPatchLinkIcon ( ) ) , null ) ; if ( link != null ) { return link ; } } return null ; }

Target:
public com.google.gerrit.client.ui.InlineHyperlink getNextPatchLink ( int index , com.google.gerrit.client.patches.PatchScreen.Type patchType ) { int nextPatchIndex = getNextPatch ( index , false , PREFERENCE_VALIDATOR ) ; if ( nextPatchIndex < 0 ) { return null ; } com.google.gerrit.client.ui.InlineHyperlink link = createLink ( nextPatchIndex , patchType , null , com.google.gwtexpui.safehtml.client.SafeHtml.asis ( Util.C.nextPatchLinkIcon ( ) ) ) ; return link ; }
Source:
protected void configure ( ) { its = createMock ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) . toInstance ( its ) ; addStandardCommentFactory = createMock ( AddStandardComment.Factory.class ) ; bind ( AddStandardComment.Factory.class ) . toInstance ( addStandardCommentFactory ) ; addVelocityCommentFactory = createMock ( AddVelocityComment.Factory.class ) ; bind ( AddVelocityComment.Factory.class ) . toInstance ( addVelocityCommentFactory ) ; }

Target:
protected void configure ( ) { its = createMock ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) . toInstance ( its ) ; addCommentFactory = createMock ( AddComment.Factory.class ) ; bind ( AddComment.Factory.class ) . toInstance ( addCommentFactory ) ; addStandardCommentFactory = createMock ( AddStandardComment.Factory.class ) ; bind ( AddStandardComment.Factory.class ) . toInstance ( addStandardCommentFactory ) ; addVelocityCommentFactory = createMock ( AddVelocityComment.Factory.class ) ; bind ( AddVelocityComment.Factory.class ) . toInstance ( addVelocityCommentFactory ) ; }
Source:
public void testCommitMessageOptionJSON ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.util.List < com.google.gerrit.server.data.ChangeAttribute > changes = executeSucessfullQuery ( ( "gerrit query --format=JSON --commit-message " + changeId ) ) ; com.google.common.truth.Truth.assertThat ( changes.size ( ) ) . isEqualTo ( 1 ) ; com.google.common.truth.Truth.assertThat ( changes.get ( 0 ) . commitMessage ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( changes.get ( 0 ) . commitMessage ) . contains ( PushOneCommit.SUBJECT ) ; }

Target:
public void testCommitMessageOptionJSON ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.util.List < com.google.gerrit.server.data.ChangeAttribute > changes = executeSuccessfulQuery ( ( "--commit-message " + changeId ) ) ; com.google.common.truth.Truth.assertThat ( changes.size ( ) ) . isEqualTo ( 1 ) ; com.google.common.truth.Truth.assertThat ( changes.get ( 0 ) . commitMessage ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( changes.get ( 0 ) . commitMessage ) . contains ( PushOneCommit.SUBJECT ) ; }
Source:
public com.google.gerrit.server.notedb.NoteDbUpdateManager.Result call ( ) throws java.lang.Exception { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schemaFactory.open ( ) ) { return rebuild ( db , id ) ; } }

Target:
public final com.google.common.util.concurrent.ListenableFuture < com.google.gerrit.server.notedb.NoteDbUpdateManager.Result > rebuildAsync ( final com.google.gerrit.reviewdb.client.Change.Id id , com.google.common.util.concurrent.ListeningExecutorService executor ) { return executor.submit ( ( ) -> { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schemaFactory.open ( ) ) { return rebuild ( db , id ) ; } } ) ; }
Source:
void onEdit ( ) { if ( canEdit ) { com.google.gwt.user.client.ui.UIObject.setVisible ( show , false ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( form , true ) ; input.setText ( text.getText ( ) ) ; input.setFocus ( true ) ; } }

Target:
void onEdit ( ) { if ( canEdit ) { com.google.gwt.user.client.ui.UIObject.setVisible ( show , false ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( form , true ) ; input.setText ( text.getText ( ) ) ; input.setFocus ( true ) ; input.selectAll ( ) ; } }
Source:
private void deleteEmail ( java.lang.String email ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( email.equals ( "ALL" ) ) { java.util.List < com.google.gerrit.extensions.common.EmailInfo > emails = getEmails.apply ( rsrc ) ; for ( com.google.gerrit.extensions.common.EmailInfo e : emails ) { deleteEmail.apply ( new com.google.gerrit.server.account.AccountResource.Email ( user , e.email ) , new com.google.gerrit.server.account.DeleteEmail.Input ( ) ) ; } } else { deleteEmail.apply ( new com.google.gerrit.server.account.AccountResource.Email ( user , email ) , new com.google.gerrit.server.account.DeleteEmail.Input ( ) ) ; } }

Target:
private void deleteEmail ( java.lang.String email ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( email.equals ( "ALL" ) ) { java.util.List < com.google.gerrit.extensions.common.EmailInfo > emails = getEmails.apply ( rsrc ) ; for ( com.google.gerrit.extensions.common.EmailInfo e : emails ) { deleteEmail.apply ( new com.google.gerrit.server.account.AccountResource.Email ( user , e.email ) , new com.google.gerrit.extensions.common.Input ( ) ) ; } } else { deleteEmail.apply ( new com.google.gerrit.server.account.AccountResource.Email ( user , email ) , new com.google.gerrit.extensions.common.Input ( ) ) ; } }
Source:
private java.lang.String getUserName ( ) { if ( ( ( userProvider ) != null ) && ( ( userProvider.get ( ) . getUserName ( ) ) != null ) ) { return userProvider.get ( ) . getUserName ( ) ; } return "?" ; }

Target:
private java.lang.String getUserName ( ) { if ( ( ( userProvider ) != null ) && ( userProvider.get ( ) . getUserName ( ) . isPresent ( ) ) ) { return userProvider.get ( ) . getUserName ( ) . get ( ) ; } return "?" ; }
Source:
public static void setDefaults ( org.eclipse.jgit.lib.Config cfg ) { cfg.setEnum ( "auth" , null , "type" , AuthType.DEVELOPMENT_BECOME_ANY_ACCOUNT ) ; cfg.setString ( "gerrit" , null , "basePath" , "git" ) ; cfg.setString ( "gerrit" , null , "allProjects" , "Test-Projects" ) ; cfg.setString ( "user" , null , "name" , "Gerrit Code Review" ) ; cfg.setString ( "user" , null , "email" , "gerrit@localhost" ) ; cfg.unset ( "cache" , null , "directory" ) ; cfg.setString ( "index" , null , "type" , "lucene" ) ; cfg.setBoolean ( "index" , "lucene" , "testInmemory" , true ) ; cfg.setInt ( "index" , "lucene" , "testVersion" , com.google.gerrit.server.index.ChangeSchemas.getLatest ( ) . getVersion ( ) ) ; cfg.setInt ( "sendemail" , null , "threadPoolSize" , 0 ) ; }

Target:
public static void setDefaults ( org.eclipse.jgit.lib.Config cfg ) { cfg.setEnum ( "auth" , null , "type" , AuthType.DEVELOPMENT_BECOME_ANY_ACCOUNT ) ; cfg.setString ( "gerrit" , null , "basePath" , "git" ) ; cfg.setString ( "gerrit" , null , "allProjects" , "Test-Projects" ) ; cfg.setString ( "user" , null , "name" , "Gerrit Code Review" ) ; cfg.setString ( "user" , null , "email" , "gerrit@localhost" ) ; cfg.unset ( "cache" , null , "directory" ) ; cfg.setString ( "index" , null , "type" , "lucene" ) ; cfg.setBoolean ( "index" , "lucene" , "testInmemory" , true ) ; cfg.setInt ( "index" , "lucene" , "testVersion" , com.google.gerrit.server.index.ChangeSchemas.getLatest ( ) . getVersion ( ) ) ; cfg.setInt ( "sendemail" , null , "threadPoolSize" , 0 ) ; cfg.setBoolean ( "receive" , null , "enableSignedPush" , false ) ; cfg.setString ( "receive" , null , "certNonceSeed" , "sekret" ) ; }
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-InputFieldTypeHint" ) ; } }

Target:
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 ( ) ) ; } }
Source:
public void testCreateSchema_DefaultAccess_RegisteredUsers ( ) throws com.google.gwtorm.client.OrmException { db.create ( ) ; final com.google.gerrit.reviewdb.SystemConfig config = db.getSystemConfig ( ) ; assertDefaultRight ( config.registeredGroupId , ApprovalCategory.READ , 1 , 2 ) ; assertDefaultRight ( config.registeredGroupId , codeReview , ( - 1 ) , 1 ) ; }

Target:
public void testCreateSchema_DefaultAccess_RegisteredUsers ( ) throws com.google.gwtorm.client.OrmException { db.create ( ) ; final com.google.gerrit.reviewdb.SystemConfig config = db.getSystemConfig ( ) ; assertDefaultRight ( "refs/*" , config.registeredGroupId , ApprovalCategory.READ , 1 , 2 ) ; assertDefaultRight ( "refs/heads/*" , config.registeredGroupId , codeReview , ( - 1 ) , 1 ) ; }
Source:
public void noChangeMessage ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.putReviewer ( changeOwner.getAccount ( ) . getId ( ) , com.google.gerrit.server.notedb.ReviewerState.REVIEWER ) ; update.commit ( ) ; org.eclipse.jgit.revwalk.RevWalk walk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ; try { org.eclipse.jgit.revwalk.RevCommit commit = walk.parseCommit ( update.getRevision ( ) ) ; walk.parseBody ( commit ) ; org.junit.Assert.assertEquals ( ( "Update patch set 1\n" + ( ( "\n" + "Patch-set: 1\n" ) + "Reviewer: Change Owner <1@gerrit>\n" ) ) , commit.getFullMessage ( ) ) ; } finally { walk.release ( ) ; } }

Target:
private org.eclipse.jgit.revwalk.RevCommit parseCommit ( org.eclipse.jgit.lib.ObjectId id ) throws java.lang.Exception { if ( id instanceof org.eclipse.jgit.revwalk.RevCommit ) { return ( ( org.eclipse.jgit.revwalk.RevCommit ) ( id ) ) ; } org.eclipse.jgit.revwalk.RevWalk walk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ; try { org.eclipse.jgit.revwalk.RevCommit commit = walk.parseCommit ( id ) ; walk.parseBody ( commit ) ; return commit ; } finally { walk.release ( ) ; } }
Source:
public void run ( ) { try { cloneCommand.doClone ( this ) ; status = GitCloneStatus.COMPLETE ; } catch ( java.lang.Exception e ) { if ( ( status ) == ( GitCloneStatus.SYNC ) ) { this . exception = e ; status = GitCloneStatus.FAILED ; } cloneCommand.cleanUp ( ) ; } }

Target:
public void run ( ) { try { cloneCommand.doClone ( this ) ; cloneCommand.configureProject ( this ) ; status = GitCloneStatus.COMPLETE ; } catch ( java.lang.Exception e ) { if ( ( status ) == ( GitCloneStatus.SYNC ) ) { this . exception = e ; status = GitCloneStatus.FAILED ; } cloneCommand.cleanUp ( ) ; } }
Source:
protected synchronized void startThread ( final com.google.gerrit.sshd.BaseCommand.CommandRunnable thunk ) { final com.google.gerrit.sshd.BaseCommand.TaskThunk tt = new com.google.gerrit.sshd.BaseCommand.TaskThunk ( thunk ) ; if ( isAdminCommand ( ) ) { new java.lang.Thread ( tt , tt.toString ( ) ) . start ( ) ; } else { task = executor.submit ( tt ) ; } }

Target:
protected synchronized void startThread ( final com.google.gerrit.sshd.BaseCommand.CommandRunnable thunk ) { final com.google.gerrit.sshd.BaseCommand.TaskThunk tt = new com.google.gerrit.sshd.BaseCommand.TaskThunk ( thunk ) ; if ( ( isAdminCommand ( ) ) || ( ( isAdminHighPriorityCommand ( ) ) && ( userProvider.get ( ) . isAdministrator ( ) ) ) ) { new java.lang.Thread ( tt , tt.toString ( ) ) . start ( ) ; } else { task = executor.submit ( tt ) ; } }
Source:
private boolean can ( com.google.gerrit.server.permissions.ProjectPermission perm ) throws com.google.gerrit.server.permissions.PermissionBackendException { switch ( perm ) { case READ : return isReadable ( ) ; } throw new com.google.gerrit.server.permissions.PermissionBackendException ( ( perm + " unsupported" ) ) ; }

Target:
private boolean can ( com.google.gerrit.server.permissions.ProjectPermission perm ) throws com.google.gerrit.server.permissions.PermissionBackendException { switch ( perm ) { case ACCESS : return ( ( ! ( isHidden ( ) ) ) && ( isReadable ( ) ) ) || ( isOwner ( ) ) ; case READ : return ( ( ! ( isHidden ( ) ) ) && ( allRefsAreVisible ( ) ) ) || ( isOwner ( ) ) ; } throw new com.google.gerrit.server.permissions.PermissionBackendException ( ( perm + " unsupported" ) ) ; }