auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void resizeCodeMirror ( ) { int height = getCodeMirrorHeight ( ) ; for ( net.codemirror.lib.CodeMirror cm : getCms ( ) ) { cm.adjustHeight ( height ) ; } }

Target:
void setShowLineNumbers ( boolean b ) { if ( b ) { getDiffTable ( ) . addStyleName ( Resources.I.diffTableStyle ( ) . showLineNumbers ( ) ) ; } else { getDiffTable ( ) . removeStyleName ( Resources.I.diffTableStyle ( ) . showLineNumbers ( ) ) ; } }
Source:
public java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > byCommitsOnBranchNotMerged ( com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.util.List < java.lang.String > hashes ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema = com.google.gerrit.server.query.change.InternalChangeQuery.schema ( indexes ) ; int batchSize ; if ( ( schema != null ) && ( schema.hasField ( ChangeField.EXACT_COMMIT ) ) ) { batchSize = 500 ; } else { batchSize = indexConfig.maxPrefixTerms ( ) ; } return byCommitsOnBranchNotMerged ( schema , branch , hashes , batchSize ) ; }

Target:
public java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > byCommitsOnBranchNotMerged ( com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.util.List < java.lang.String > hashes ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema = com.google.gerrit.server.query.change.InternalChangeQuery.schema ( indexes ) ; int batchSize ; if ( ( schema != null ) && ( schema.hasField ( ChangeField.EXACT_COMMIT ) ) ) { batchSize = ( indexConfig.maxTerms ( ) ) - 3 ; } else { batchSize = indexConfig.maxPrefixTerms ( ) ; } return byCommitsOnBranchNotMerged ( schema , branch , hashes , batchSize ) ; }
Source:
public final void check ( com.google.gerrit.server.schema.UpdateUI ui , com.google.gerrit.reviewdb.client.CurrentSchemaVersion curr , com.google.gerrit.reviewdb.server.ReviewDb db , boolean toTargetVersion ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { if ( ( curr.versionNbr ) == ( versionNbr ) ) { } else { upgradeFrom ( ui , curr , db , toTargetVersion ) ; } }

Target:
private java.util.List < com.google.gerrit.server.schema.SchemaVersion > pending ( int curr ) { java.util.List < com.google.gerrit.server.schema.SchemaVersion > r = com.google.common.collect.Lists.newArrayListWithCapacity ( ( ( versionNbr ) - curr ) ) ; for ( com.google.gerrit.server.schema.SchemaVersion v = this ; curr < ( v.getVersionNbr ( ) ) ; v = v.prior.get ( ) ) { r.add ( v ) ; } java.util.Collections.reverse ( r ) ; return r ; }
Source:
public java.util.Optional < java.lang.String > permissionName ( ) { return java.util.Optional.of ( com.google.gerrit.common.data.Permission.forLabel ( label ( ) ) ) ; }

Target:
public java.util.Optional < java.lang.String > permissionName ( ) { switch ( forUser ) { case SELF : return java.util.Optional.of ( com.google.gerrit.common.data.Permission.forLabel ( name ) ) ; case ON_BEHALF_OF : return java.util.Optional.of ( com.google.gerrit.common.data.Permission.forLabelAs ( name ) ) ; } return java.util.Optional.empty ( ) ; }
Source:
public void run ( ) { int height = ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - ( ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + 18 ) ; cmA.setHeight ( height ) ; cmB.setHeight ( height ) ; render ( diff ) ; commentManager.render ( comments , prefs.expandAllComments ( ) ) ; skipManager.render ( prefs.context ( ) , diff ) ; }

Target:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent event ) { toggleShowIntraline ( ) ; }
Source:
public static java.util.List < java.lang.reflect.Field > getDeclaredFields ( java.lang.Class < ? > in ) { return com.google.common.collect.Ordering.natural ( ) . onResultOf ( new com.google.common.base.Function < java.lang.reflect.Field , java.lang.String > ( ) { @ java.lang.Override public java.lang.String apply ( java.lang.reflect.Field f ) { return f.getName ( ) ; } } ) . sortedCopy ( java.util.Arrays.asList ( in.getDeclaredFields ( ) ) ) ; }

Target:
public static java.util.List < java.lang.reflect.Field > getDeclaredFields ( java.lang.Class < ? > in ) { return com.google.gwtorm.schema.java.JavaColumnModel.sort ( java.util.Arrays.asList ( in.getDeclaredFields ( ) ) ) ; }
Source:
public static void putMessage ( com.google.gerrit.reviewdb.client.PatchSet.Id id , java.lang.String m , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > r ) { com.google.gerrit.client.changes.ChangeFileApi.putMessage ( id.getParentKey ( ) , m , r ) ; }

Target:
public static void putContentOrMessage ( com.google.gerrit.reviewdb.client.PatchSet.Id id , java.lang.String path , java.lang.String content , com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.VoidResult > result ) { if ( Patch.COMMIT_MSG.equals ( path ) ) { com.google.gerrit.client.changes.ChangeFileApi.putMessage ( id , content , result ) ; } else { com.google.gerrit.client.changes.ChangeFileApi.contentEdit ( id.getParentKey ( ) , path ) . put ( content , result ) ; } }
Source:
public void addAllReviewers ( com.google.gerrit.reviewdb.server.ReviewDb db , 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 , 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 ) ) ; } } }

Target:
public void addAllReviewers ( com.google.gerrit.reviewdb.server.ReviewDb db , 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 , notes ) . all ( ) ; 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:
static com.google.gerrit.server.plugins.Plugin.ApiType getApiType ( java.util.jar.Manifest manifest ) throws com.google.gerrit.server.plugins.InvalidPluginException { java.util.jar.Attributes main = manifest.getMainAttributes ( ) ; java.lang.String v = main.getValue ( "Gerrit-ApiType" ) ; if ( ( com.google.common.base.Strings.isNullOrEmpty ( v ) ) || ( com.google.gerrit.server.plugins.Plugin.ApiType.EXTENSION.name ( ) . equalsIgnoreCase ( v ) ) ) { return com.google.gerrit.server.plugins.Plugin.ApiType.EXTENSION ; } else if ( com.google.gerrit.server.plugins.Plugin.ApiType.PLUGIN.name ( ) . equalsIgnoreCase ( v ) ) { return com.google.gerrit.server.plugins.Plugin.ApiType.PLUGIN ; } else { throw new com.google.gerrit.server.plugins.InvalidPluginException ( ( "Invalid Gerrit-ApiType: " + v ) ) ; } }

Target:
protected void configure ( ) { bind ( com.google.gerrit.extensions.systemstatus.ServerInformation.class ) . toInstance ( srvInfo ) ; }
Source:
public java.util.Optional < com.google.gerrit.server.account.AccountState > getByUsername ( java.lang.String username ) { try { com.google.gerrit.server.account.externalids.ExternalId extId = externalIds.get ( ExternalId.Key.create ( com.google.gerrit.server.account.externalids.ExternalId.SCHEME_USERNAME , username ) ) ; if ( extId == null ) { return java.util.Optional.empty ( ) ; } return java.util.Optional.ofNullable ( getOrNull ( extId.accountId ( ) ) ) ; } catch ( java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException e ) { com.google.gerrit.server.account.AccountCacheImpl.log.warn ( ( "Cannot load AccountState for username " + username ) , e ) ; return null ; } }

Target:
public java.util.Optional < com.google.gerrit.server.account.AccountState > getByUsername ( java.lang.String username ) { try { com.google.gerrit.server.account.externalids.ExternalId extId = externalIds.get ( ExternalId.Key.create ( com.google.gerrit.server.account.externalids.ExternalId.SCHEME_USERNAME , username ) ) ; if ( extId == null ) { return java.util.Optional.empty ( ) ; } return maybeGet ( extId.accountId ( ) ) ; } catch ( java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException e ) { com.google.gerrit.server.account.AccountCacheImpl.log.warn ( ( "Cannot load AccountState for username " + username ) , e ) ; return null ; } }
Source:
public void onActivityCreated ( android.os.Bundle savedInstanceState ) { super . onActivityCreated ( savedInstanceState ) ; com.google.reviewit.util.TaskObserver.enableProgressBar ( getWindow ( ) ) ; getWindow ( ) . setSoftInputMode ( WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN ) ; int vote = getArguments ( ) . getInt ( com.google.reviewit.PostReviewFragment.VOTE ) ; com.google.reviewit.app.Change change = getApp ( ) . getCurrentChange ( ) ; setTitle ( getString ( R.string.detailed_change_title , change.info._number ) ) ; ( ( com.google.reviewit.widget.PostReviewView ) ( v ( R.id.postReview ) ) ) . init ( getApp ( ) , this , vote , com.google.reviewit.SortChangesFragment.class ) ; }

Target:
public void onActivityCreated ( android.os.Bundle savedInstanceState ) { super . onActivityCreated ( savedInstanceState ) ; com.google.reviewit.util.TaskObserver.enableProgressBar ( getWindow ( ) ) ; getWindow ( ) . setSoftInputMode ( WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN ) ; int vote = getArguments ( ) . getInt ( com.google.reviewit.PostReviewFragment.VOTE ) ; com.google.reviewit.app.Change change = getApp ( ) . getCurrentChange ( ) ; setTitle ( getString ( R.string.detailed_change_title , change.info._number ) ) ; ( ( com.google.reviewit.widget.PostReviewView ) ( v ( R.id.postReview ) ) ) . initWithExpandableCommitMessageAndApprovals ( getApp ( ) , this , vote , com.google.reviewit.SortChangesFragment.class ) ; }
Source:
public void run ( ) { ui.header ( "Git Repositories" ) ; java.io.File d = gerrit.path ( "Location of Git repositories" , "basePath" , "git" ) ; if ( d == null ) { throw com.google.gerrit.pgm.init.api.InitUtil.die ( "gerrit.basePath is required" ) ; } if ( ( ! ( d.exists ( ) ) ) && ( ! ( d.mkdirs ( ) ) ) ) { throw com.google.gerrit.pgm.init.api.InitUtil.die ( ( "Cannot create " + d ) ) ; } }

Target:
public void run ( ) { ui.header ( "Git Repositories" ) ; java.nio.file.Path d = gerrit.path ( "Location of Git repositories" , "basePath" , "git" ) ; if ( d == null ) { throw com.google.gerrit.pgm.init.api.InitUtil.die ( "gerrit.basePath is required" ) ; } com.google.gerrit.common.FileUtil.mkdirsOrDie ( d , "Cannot create" ) ; }
Source:
private void update ( org.eclipse.jgit.revwalk.RevCommit rev ) throws java.lang.Exception { org.eclipse.jgit.lib.RefUpdate u = db.updateRef ( RefNames.REFS_CONFIG ) ; u.disableRefLog ( ) ; u.setNewObjectId ( rev ) ; switch ( u.forceUpdate ( ) ) { case FAST_FORWARD : case FORCED : case NEW : case NO_CHANGE : break ; default : org.junit.Assert.fail ( ( "Cannot update ref for test: " + ( u.getResult ( ) ) ) ) ; } }

Target:
private void update ( org.eclipse.jgit.revwalk.RevCommit rev ) throws java.lang.Exception { org.eclipse.jgit.lib.RefUpdate u = db.updateRef ( RefNames.REFS_CONFIG ) ; u.disableRefLog ( ) ; u.setNewObjectId ( rev ) ; org.eclipse.jgit.lib.RefUpdate.Result result = u.forceUpdate ( ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( ( "Cannot update ref for test: " + result ) ) . that ( result ) . isAnyOf ( Result.FAST_FORWARD , Result.FORCED , Result.NEW , Result.NO_CHANGE ) ; }
Source:
public boolean indexChange ( int changeId ) { try { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult result = httpSession.post ( buildIndexEndpoint ( changeId ) ) ; if ( result.isSuccessful ( ) ) { return true ; } com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.log.error ( "Unable to index change {}. Cause: {}" , changeId , result.getMessage ( ) ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.log.error ( ( "Error trying to index change " + changeId ) , e ) ; } return false ; }

Target:
com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult send ( ) throws java.io.IOException { return httpSession.post ( buildIndexEndpoint ( changeId ) ) ; }
Source:
private void styleCommentRow ( final int row ) { final com.google.gwt.user.client.ui.HTMLTable.CellFormatter fmt = table.getCellFormatter ( ) ; final com.google.gwt.user.client.Element iconCell = fmt.getElement ( row , 0 ) ; com.google.gwt.user.client.ui.UIObject.setStyleName ( com.google.gwt.user.client.DOM.getParent ( iconCell ) , "CommentHolder" , true ) ; }

Target:
private void styleCommentRow ( final int row ) { final com.google.gwt.user.client.ui.HTMLTable.CellFormatter fmt = table.getCellFormatter ( ) ; final com.google.gwt.user.client.Element iconCell = fmt.getElement ( row , 0 ) ; com.google.gwt.user.client.ui.UIObject.setStyleName ( com.google.gwt.user.client.DOM.getParent ( iconCell ) , Gerrit.RESOURCES.css ( ) . commentHolder ( ) , true ) ; }
Source:
public static java.util.Set < java.lang.String > groupFields ( com.google.gerrit.server.index.QueryOptions opts ) { java.util.Set < java.lang.String > fs = opts.fields ( ) ; return fs.contains ( GroupField.UUID.getName ( ) ) ? fs : com.google.common.collect.Sets.union ( fs , com.google.common.collect.ImmutableSet.of ( GroupField.UUID.getName ( ) ) ) ; }

Target:
public static java.util.Set < java.lang.String > groupFields ( com.google.gerrit.index.QueryOptions opts ) { java.util.Set < java.lang.String > fs = opts.fields ( ) ; return fs.contains ( GroupField.UUID.getName ( ) ) ? fs : com.google.common.collect.Sets.union ( fs , com.google.common.collect.ImmutableSet.of ( GroupField.UUID.getName ( ) ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { normalProject = createProject ( "normal" ) ; secretProject = createProject ( "secret" ) ; secretRefProject = createProject ( "secretRef" ) ; privilegedGroup = groupCache.get ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( createGroup ( "privilegedGroup" ) ) ) ; privilegedUser = accounts.create ( "privilegedUser" , "snowden@nsa.gov" , "Ed Snowden" ) ; gApi.groups ( ) . id ( privilegedGroup.getGroupUUID ( ) . get ( ) ) . addMembers ( privilegedUser.username ) ; com.google.common.truth.Truth.assertThat ( gApi.groups ( ) . id ( privilegedGroup.getGroupUUID ( ) . get ( ) ) . members ( ) . get ( 0 ) . email ) . contains ( "snowden" ) ; grant ( Permission.READ , secretProject , "refs/*" , false , privilegedGroup.getGroupUUID ( ) ) ; block ( Permission.READ , SystemGroupBackend.REGISTERED_USERS , "refs/*" , secretProject ) ; deny ( secretRefProject , Permission.READ , SystemGroupBackend.ANONYMOUS_USERS , "refs/*" ) ; grant ( Permission.READ , secretRefProject , "refs/heads/secret/*" , false , privilegedGroup.getGroupUUID ( ) ) ; block ( Permission.READ , SystemGroupBackend.REGISTERED_USERS , "refs/heads/secret/*" , secretRefProject ) ; grant ( Permission.READ , secretRefProject , "refs/heads/*" , false , SystemGroupBackend.REGISTERED_USERS ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { normalProject = createProject ( "normal" ) ; secretProject = createProject ( "secret" ) ; secretRefProject = createProject ( "secretRef" ) ; privilegedGroup = groupCache.get ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( createGroup ( "privilegedGroup" ) ) ) ; privilegedUser = accounts.create ( "privilegedUser" , "snowden@nsa.gov" , "Ed Snowden" ) ; gApi.groups ( ) . id ( privilegedGroup.getGroupUUID ( ) . get ( ) ) . addMembers ( privilegedUser.username ) ; com.google.common.truth.Truth.assertThat ( gApi.groups ( ) . id ( privilegedGroup.getGroupUUID ( ) . get ( ) ) . members ( ) . get ( 0 ) . email ) . contains ( "snowden" ) ; grant ( secretProject , "refs/*" , Permission.READ , false , privilegedGroup.getGroupUUID ( ) ) ; block ( secretProject , "refs/*" , Permission.READ , SystemGroupBackend.REGISTERED_USERS ) ; deny ( secretRefProject , "refs/*" , Permission.READ , SystemGroupBackend.ANONYMOUS_USERS ) ; grant ( secretRefProject , "refs/heads/secret/*" , Permission.READ , false , privilegedGroup.getGroupUUID ( ) ) ; block ( secretRefProject , "refs/heads/secret/*" , Permission.READ , SystemGroupBackend.REGISTERED_USERS ) ; grant ( secretRefProject , "refs/heads/*" , Permission.READ , false , SystemGroupBackend.REGISTERED_USERS ) ; }
Source:
private static void error ( final com.google.gwtjsonrpc.server.ActiveCall call , final int status , final java.lang.String message ) throws java.io.IOException { final javax.servlet.http.HttpServletResponse r = call.httpResponse ; r.setStatus ( status ) ; r.setContentType ( ( "text/plain; charset=" + ( com.google.gwtjsonrpc.server.JsonServlet.ENC ) ) ) ; final java.io.Writer w = new java.io.OutputStreamWriter ( r.getOutputStream ( ) , com.google.gwtjsonrpc.server.JsonServlet.ENC ) ; try { w.write ( message ) ; } finally { w.close ( ) ; } }

Target:
private static void textError ( final com.google.gwtjsonrpc.server.ActiveCall call , final int status , final java.lang.String message ) throws java.io.IOException { final javax.servlet.http.HttpServletResponse r = call.httpResponse ; r.setStatus ( status ) ; r.setContentType ( ( "text/plain; charset=" + ( com.google.gwtjsonrpc.server.JsonServlet.ENC ) ) ) ; final java.io.Writer w = new java.io.OutputStreamWriter ( r.getOutputStream ( ) , com.google.gwtjsonrpc.server.JsonServlet.ENC ) ; try { w.write ( message ) ; } finally { w.close ( ) ; } }
Source:
public org.kohsuke.github.GitHub login ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.AccessToken authToken ) throws java.io.IOException { this . token = authToken ; this . hub = org.kohsuke.github.GitHub.connectUsingOAuth ( authToken.access_token ) ; this . myself = hub.getMyself ( ) ; return this . hub ; }

Target:
public org.kohsuke.github.GitHub login ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.AccessToken authToken ) throws java.io.IOException { com.googlesource.gerrit.plugins.github.oauth.GitHubLogin.log.debug ( "Logging in using access token {}" , authToken.accessToken ) ; this . token = authToken ; this . hub = org.kohsuke.github.GitHub.connectUsingOAuth ( authToken.accessToken ) ; this . myself = hub.getMyself ( ) ; return this . hub ; }
Source:
public void testIsNotSuccessful ( ) throws java.lang.Exception { org.apache.http.HttpResponse response = setupMocks ( com.ericsson.gerrit.plugins.highavailability.IndexResponseHandlerTest.ERROR , com.ericsson.gerrit.plugins.highavailability.IndexResponseHandlerTest.ERROR_ENTITY ) ; com.ericsson.gerrit.plugins.highavailability.IndexResponseHandler.IndexResult result = handler.handleResponse ( response ) ; com.google.common.truth.Truth.assertThat ( result.isSuccessful ( ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( result.getMessage ( ) ) . contains ( com.ericsson.gerrit.plugins.highavailability.IndexResponseHandlerTest.ERROR_ENTITY ) ; }

Target:
public void testIsNotSuccessful ( ) throws java.lang.Exception { org.apache.http.HttpResponse response = setupMocks ( com.ericsson.gerrit.plugins.highavailability.HttpResponseHandlerTest.ERROR , com.ericsson.gerrit.plugins.highavailability.HttpResponseHandlerTest.ERROR_ENTITY ) ; com.ericsson.gerrit.plugins.highavailability.HttpResponseHandler.HttpResult result = handler.handleResponse ( response ) ; com.google.common.truth.Truth.assertThat ( result.isSuccessful ( ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( result.getMessage ( ) ) . contains ( com.ericsson.gerrit.plugins.highavailability.HttpResponseHandlerTest.ERROR_ENTITY ) ; }
Source:
void setShowIntraline ( boolean b ) { if ( b && ( ( getIntraLineStatus ( ) ) == ( DiffInfo.IntraLineStatus.OFF ) ) ) { reloadDiffInfo ( ) ; } else if ( b ) { diffTable.removeStyleName ( DiffTable.style.noIntraline ( ) ) ; } else { diffTable.addStyleName ( DiffTable.style.noIntraline ( ) ) ; } }

Target:
private com.google.gerrit.client.diff.DraftBox addNewDraft ( net.codemirror.lib.CodeMirror cm , int line , net.codemirror.lib.TextMarker.FromTo fromTo ) { com.google.gerrit.client.diff.DisplaySide side = getSideFromCm ( cm ) ; return addDraftBox ( com.google.gerrit.client.changes.CommentInfo.createRange ( path , getStoredSideFromDisplaySide ( side ) , ( line + 1 ) , null , null , com.google.gerrit.client.diff.CommentRange.create ( fromTo ) ) , side ) ; }
Source:
public void testBlockPushDrafts ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/for/refs/*" ) ; com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/drafts/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; org.junit.Assert.assertTrue ( "can upload refs/heads/master" , u.controlForRef ( "refs/heads/master" ) . canUpload ( ) ) ; org.junit.Assert.assertTrue ( "push is blocked to refs/drafts/master" , u.controlForRef ( "refs/drafts/refs/heads/master" ) . isBlocked ( com.google.gerrit.common.data.Permission.PUSH ) ) ; }

Target:
public void testBlockPushDraftsUnblockAdmin ( ) { com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/drafts/*" ) ; com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ADMIN , "refs/drafts/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; com.google.gerrit.server.project.ProjectControl a = util.user ( local , "a" , com.google.gerrit.server.project.Util.ADMIN ) ; assertBlocked ( com.google.gerrit.common.data.Permission.PUSH , "refs/drafts/refs/heads/master" , u ) ; assertNotBlocked ( com.google.gerrit.common.data.Permission.PUSH , "refs/drafts/refs/heads/master" , a ) ; }
Source:
public void starChange ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.ChangeResource rsrc = changes.parse ( TopLevelResource.INSTANCE , com.google.gerrit.extensions.restapi.IdString.fromUrl ( id ) ) ; starredChangesCreate.setChange ( rsrc ) ; starredChangesCreate.apply ( account , new com.google.gerrit.server.account.StarredChanges.EmptyInput ( ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot star change" , e ) ; } }

Target:
public void unstarChange ( java.lang.String changeId ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.ChangeResource rsrc = changes.parse ( TopLevelResource.INSTANCE , com.google.gerrit.extensions.restapi.IdString.fromUrl ( changeId ) ) ; com.google.gerrit.server.account.AccountResource.StarredChange starredChange = new com.google.gerrit.server.account.AccountResource.StarredChange ( account.getUser ( ) , rsrc ) ; starredChangesDelete.apply ( starredChange , new com.google.gerrit.server.account.StarredChanges.EmptyInput ( ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot unstar change" , e ) ; } }
Source:
public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { int jumpTo = - 1 ; for ( int i = 0 ; i < ( table.getRowCount ( ) ) ; i ++ ) { if ( ( getRowItem ( i ) ) == k ) { table.removeRow ( i ) ; movePointerTo ( jumpTo ) ; break ; } else if ( ( getRowItem ( i ) ) != null ) { jumpTo = i ; } } }

Target:
public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.client.reviewdb.AccountSshKey k = getRowItem ( row ) ; if ( ( k != null ) && ( ids.contains ( k.getKey ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }
Source:
public void setExisting_Conflict ( ) throws java.lang.Exception { com.google.gerrit.server.account.PutUsername.Input in = new com.google.gerrit.server.account.PutUsername.Input ( ) ; in.username = admin.username ; adminRestSession.put ( ( ( "/accounts/" + ( createUser ( ) . get ( ) ) ) + "/username" ) , in ) . assertConflict ( ) ; }

Target:
public void setExisting_Conflict ( ) throws java.lang.Exception { com.google.gerrit.server.account.PutUsername.Input in = new com.google.gerrit.server.account.PutUsername.Input ( ) ; in.username = admin.username ; adminRestSession.put ( ( ( "/accounts/" + ( accounts.create ( ) . id.get ( ) ) ) + "/username" ) , in ) . assertConflict ( ) ; }
Source:
public void testUnblockInLocalForceEditTopicName_Fails ( ) { com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; org.junit.Assert.assertFalse ( "u can't edit topic name" , u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) ; }

Target:
public void testUnblockForceEditTopicName ( ) { com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.common.truth.Truth.assertThat ( u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) . named ( "u can edit topic name" ) . isTrue ( ) ; }
Source:
public void testUpsertOneExisting ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchOK ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 1 ) ; createClassUnderTest ( ) . upsert ( com.google.gwtorm.jdbc.TestJdbcAccess.ONE_ROW ) ; }

Target:
public void testUpsertTwoNotExistingZeroLengthArray ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , 1 , 1 ) ; createClassUnderTest ( ) . upsert ( twoRows ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( insert ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertExpectedIdsUsed ( insert , 1 , 2 ) ; }
Source:
public void setAssigneeOnReviewableWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableWipChange ( ) ; assign ( sc , sc.owner , sc.assignee ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . to ( sc.assignee ) ; }

Target:
public void setAssigneeOnWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; assign ( sc , sc.owner , sc.assignee ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . to ( sc.assignee ) . noOneElse ( ) ; }
Source:
private void printNode ( final com.google.gerrit.sshd.commands.TreeNode node , final int level , final boolean isLast ) { printIndention ( level ) ; stdout.print ( ( isLast ? com.google.gerrit.sshd.commands.TreeFormatter.LAST_NODE_PREFIX : com.google.gerrit.sshd.commands.TreeFormatter.NODE_PREFIX ) ) ; if ( node.isVisible ( ) ) { stdout.print ( node.getDisplayName ( ) ) ; } else { stdout.print ( com.google.gerrit.sshd.commands.TreeFormatter.NOT_VISIBLE_NODE ) ; } stdout.print ( "\n" ) ; }

Target:
private void printNode ( final com.google.gerrit.sshd.commands.TreeFormatter.TreeNode node , final int level , final boolean isLast ) { printIndention ( level ) ; stdout.print ( ( isLast ? com.google.gerrit.sshd.commands.TreeFormatter.LAST_NODE_PREFIX : com.google.gerrit.sshd.commands.TreeFormatter.NODE_PREFIX ) ) ; if ( node.isVisible ( ) ) { stdout.print ( node.getDisplayName ( ) ) ; } else { stdout.print ( com.google.gerrit.sshd.commands.TreeFormatter.NOT_VISIBLE_NODE ) ; } stdout.print ( "\n" ) ; }
Source:
private synchronized java.util.List < com.google.gerrit.client.reviewdb.TrustedExternalId > getTrustedIds ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { if ( ( trustedIds ) == null ) { trustedIds = java.util.Collections.unmodifiableList ( db.trustedExternalIds ( ) . all ( ) . toList ( ) ) ; } return trustedIds ; }

Target:
public synchronized java.util.List < com.google.gerrit.client.reviewdb.TrustedExternalId > getTrustedExternalIds ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { if ( ( trustedIds ) == null ) { trustedIds = java.util.Collections.unmodifiableList ( db.trustedExternalIds ( ) . all ( ) . toList ( ) ) ; } return trustedIds ; }
Source:
public com.gitblit.models.UserModel authenticate ( javax.servlet.http.HttpServletRequest httpRequest ) { java.lang.String gerritUsername = ( ( java.lang.String ) ( httpRequest.getAttribute ( "gerrit-username" ) ) ) ; java.lang.String gerritToken = ( ( java.lang.String ) ( httpRequest.getAttribute ( "gerrit-token" ) ) ) ; if ( ( com.google.common.base.Strings.isNullOrEmpty ( gerritUsername ) ) || ( com.google.common.base.Strings.isNullOrEmpty ( gerritToken ) ) ) { return null ; } httpRequest.getSession ( ) . setAttribute ( Constants.AUTHENTICATION_TYPE , AuthenticationType.CONTAINER ) ; return authenticateSSO ( gerritUsername , gerritToken ) ; }

Target:
public com.gitblit.models.UserModel authenticate ( javax.servlet.http.HttpServletRequest httpRequest ) { java.lang.String gerritUsername = ( ( java.lang.String ) ( httpRequest.getAttribute ( "gerrit-username" ) ) ) ; java.lang.String gerritToken = ( ( java.lang.String ) ( httpRequest.getAttribute ( "gerrit-token" ) ) ) ; httpRequest.getSession ( ) . setAttribute ( Constants.AUTHENTICATION_TYPE , AuthenticationType.CONTAINER ) ; if ( ( com.google.common.base.Strings.isNullOrEmpty ( gerritUsername ) ) || ( com.google.common.base.Strings.isNullOrEmpty ( gerritToken ) ) ) { return com.googlesource.gerrit.plugins.gitblit.auth.GerritToGitBlitUserModel.getAnonymous ( projectControl ) ; } else { return authenticateSSO ( gerritUsername , gerritToken ) ; } }
Source:
public java.lang.Thread newThread ( final java.lang.Runnable task ) { final java.lang.Thread t = parent.newThread ( task ) ; t.setName ( ( ( prefix + "-" ) + ( tid.getAndIncrement ( ) ) ) ) ; return t ; }

Target:
public java.lang.Thread newThread ( final java.lang.Runnable task ) { final java.lang.Thread t = parent.newThread ( task ) ; t.setName ( ( ( prefix + "-" ) + ( tid.getAndIncrement ( ) ) ) ) ; t.setUncaughtExceptionHandler ( com.google.gerrit.server.git.WorkQueue.LOG_UNCAUGHT_EXCEPTION ) ; return t ; }
Source:
protected void onLoad ( com.google.gerrit.server.notedb.LoadHandle handle ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.ObjectId rev = handle.id ( ) ; if ( rev == null ) { loadDefaults ( ) ; return ; } com.google.gerrit.server.notedb.ChangeNotesParser parser = new com.google.gerrit.server.notedb.ChangeNotesParser ( change.getId ( ) , rev , handle.walk ( ) , args.noteUtil , args.metrics ) ; state = parser.parseAll ( ) ; state.copyColumnsTo ( change ) ; revisionNoteMap = parser.getRevisionNoteMap ( ) ; }

Target:
protected void onLoad ( com.google.gerrit.server.notedb.LoadHandle handle ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.ObjectId rev = handle.id ( ) ; if ( rev == null ) { loadDefaults ( ) ; return ; } com.google.gerrit.server.notedb.ChangeNotesCache.Value v = args.cache.get ( ) . get ( getProjectName ( ) , getChangeId ( ) , rev , handle.walk ( ) ) ; state = v.state ( ) ; state.copyColumnsTo ( change ) ; revisionNoteMap = v.revisionNoteMap ( ) ; }
Source:
private void installFileList ( ) { fileList.setRegisterKeys ( true ) ; fileList.movePointerTo ( callerKey ) ; }

Target:
public void open ( ) { if ( ! ( fileList.isLoaded ( ) ) ) { sp.setHeight ( "22px" ) ; } sp.setWidth ( ( ( ( com.google.gwt.user.client.Window.getClientWidth ( ) ) - 60 ) + "px" ) ) ; setPopupPositionAndShow ( this ) ; if ( fileList.isLoaded ( ) ) { fileList.setRegisterKeys ( true ) ; fileList.movePointerTo ( callerKey ) ; } }
Source:
public void testFindAfterCommon ( ) { com.google.gerrit.client.diff.LineMapper mapper = new com.google.gerrit.client.diff.LineMapper ( ) ; mapper.appendCommon ( 10 ) ; org.junit.Assert.assertEquals ( new com.google.gerrit.client.diff.LineMapper.LineOnOtherInfo ( 10 , true ) , mapper.lineOnOther ( Side.PARENT , 10 ) ) ; org.junit.Assert.assertEquals ( new com.google.gerrit.client.diff.LineMapper.LineOnOtherInfo ( 10 , true ) , mapper.lineOnOther ( Side.REVISION , 10 ) ) ; }

Target:
public void testFindAfterCommon ( ) { com.google.gerrit.client.diff.LineMapper mapper = new com.google.gerrit.client.diff.LineMapper ( ) ; mapper.appendCommon ( 10 ) ; org.junit.Assert.assertEquals ( new com.google.gerrit.client.diff.LineMapper.LineOnOtherInfo ( 10 , true ) , mapper.lineOnOther ( DisplaySide.A , 10 ) ) ; org.junit.Assert.assertEquals ( new com.google.gerrit.client.diff.LineMapper.LineOnOtherInfo ( 10 , true ) , mapper.lineOnOther ( DisplaySide.B , 10 ) ) ; }
Source:
public com.google.common.collect.ListMultimap < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSetApproval > allApprovalsMap ( ) throws com.google.gwtorm.server.OrmException { if ( ( allApprovals ) == null ) { allApprovals = com.google.common.collect.ArrayListMultimap.create ( ) ; for ( com.google.gerrit.reviewdb.client.PatchSetApproval psa : com.google.gerrit.server.ApprovalsUtil.sortApprovals ( db.patchSetApprovals ( ) . byChange ( legacyId ) ) ) { allApprovals.put ( psa.getPatchSetId ( ) , psa ) ; } } return allApprovals ; }

Target:
public com.google.common.collect.ListMultimap < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSetApproval > allApprovalsMap ( ) throws com.google.gwtorm.server.OrmException { if ( ( allApprovals ) == null ) { allApprovals = approvalsUtil.byChange ( db , notes ( ) ) ; } return allApprovals ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.ChangeHooks.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.EventSource.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; listener ( ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.ChangeHooks.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.EventDispatcher.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.EventSource.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; listener ( ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; }
Source:
protected void service ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException , javax.servlet.ServletException { res.setHeader ( "Expires" , "Fri, 01 Jan 1980 00:00:00 GMT" ) ; res.setHeader ( "Pragma" , "no-cache" ) ; res.setHeader ( "Cache-Control" , "no-cache, must-revalidate" ) ; super . service ( req , res ) ; }

Target:
protected void service ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException , javax.servlet.ServletException { com.google.gerrit.httpd.RestApiServlet.noCache ( res ) ; try { super . service ( req , res ) ; } catch ( java.lang.Error err ) { com.google.gerrit.httpd.RestApiServlet.handleError ( err , req , res ) ; } catch ( java.lang.RuntimeException err ) { com.google.gerrit.httpd.RestApiServlet.handleError ( err , req , res ) ; } }
Source:
private static com.google.gerrit.client.rpc.RestApi getRestApi ( com.google.gerrit.reviewdb.client.Project.NameKey name , java.lang.String viewName , int limit , int start , java.lang.String match ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.projects.ProjectApi.project ( name ) . view ( viewName ) ; call.addParameter ( "n" , limit ) ; call.addParameter ( "s" , start ) ; if ( match != null ) { if ( match.startsWith ( "^" ) ) { call.addParameter ( "r" , match ) ; } else { call.addParameter ( "m" , match ) ; } } return call ; }

Target:
private static com.google.gerrit.client.rpc.RestApi getRestApi ( com.google.gerrit.reviewdb.client.Project.NameKey name , java.lang.String viewName , int limit , int start , java.lang.String match ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.projects.ProjectApi.project ( name ) . view ( viewName ) ; call.addParameter ( "n" , limit ) ; call.addParameter ( "S" , start ) ; if ( match != null ) { if ( match.startsWith ( "^" ) ) { call.addParameter ( "r" , match ) ; } else { call.addParameter ( "m" , match ) ; } } return call ; }
Source:
private void setUp ( ) throws java.lang.Exception { injector = com.google.inject.Guice.createInjector ( new com.google.gerrit.testutil.InMemoryModule ( ) ) ; injector.injectMembers ( this ) ; lifecycle = new com.google.gerrit.lifecycle.LifecycleManager ( ) ; lifecycle.add ( injector ) ; lifecycle.start ( ) ; try ( com.google.gerrit.reviewdb.server.ReviewDb underlyingDb = inMemoryDatabase.getDatabase ( ) . open ( ) ) { schemaCreator.create ( underlyingDb ) ; } db = schemaFactory.open ( ) ; setApiUser ( accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "user" ) ) . getAccountId ( ) ) ; }

Target:
private void setUp ( ) throws java.lang.Exception { injector = com.google.inject.Guice.createInjector ( new com.google.gerrit.testing.InMemoryModule ( ) ) ; injector.injectMembers ( this ) ; lifecycle = new com.google.gerrit.lifecycle.LifecycleManager ( ) ; lifecycle.add ( injector ) ; lifecycle.start ( ) ; try ( com.google.gerrit.reviewdb.server.ReviewDb underlyingDb = inMemoryDatabase.getDatabase ( ) . open ( ) ) { schemaCreator.create ( underlyingDb ) ; } db = schemaFactory.open ( ) ; setApiUser ( accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "user" ) ) . getAccountId ( ) ) ; }
Source:
private com.google.gerrit.server.notedb.ChangeNotes createFromChangeOnlyWhenNotedbDisabled ( com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkState ( ( ! ( migration.readChanges ( ) ) ) , ( "do not call" + " createFromChangeWhenNotedbDisabled when notedb is enabled" ) ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( repoManager , migration , allUsers , noteUtil , change.getProject ( ) , change ) . load ( ) ; }

Target:
private com.google.gerrit.server.notedb.ChangeNotes createFromChangeOnlyWhenNoteDbDisabled ( com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkState ( ( ! ( migration.readChanges ( ) ) ) , ( "do not call" + " createFromChangeWhenNoteDbDisabled when NoteDb is enabled" ) ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( repoManager , migration , allUsers , noteUtil , change.getProject ( ) , change ) . load ( ) ; }
Source:
public com.google.gerrit.server.project.FileResource parse ( com.google.gerrit.server.project.CommitResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { if ( Patch.COMMIT_MSG.equals ( id.get ( ) ) ) { return new com.google.gerrit.server.project.FileResource ( parent.getProject ( ) , parent.getCommit ( ) , id.get ( ) ) ; } return com.google.gerrit.server.project.FileResource.create ( repoManager , parent.getProject ( ) , parent.getCommit ( ) , id.get ( ) ) ; }

Target:
public com.google.gerrit.server.project.FileResource parse ( com.google.gerrit.server.project.CommitResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { if ( com.google.gerrit.reviewdb.client.Patch.isMagic ( id.get ( ) ) ) { return new com.google.gerrit.server.project.FileResource ( parent.getProject ( ) , parent.getCommit ( ) , id.get ( ) ) ; } return com.google.gerrit.server.project.FileResource.create ( repoManager , parent.getProject ( ) , parent.getCommit ( ) , id.get ( ) ) ; }
Source:
private int getEffectiveLimit ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p ) { java.util.List < java.lang.Integer > possibleLimits = new java.util.ArrayList < > ( 3 ) ; possibleLimits.add ( getPermittedLimit ( ) ) ; if ( ( limitFromCaller ) > 0 ) { possibleLimits.add ( limitFromCaller ) ; } java.lang.Integer limitFromPredicate = com.google.gerrit.server.query.change.LimitPredicate.getLimit ( p ) ; if ( limitFromPredicate != null ) { possibleLimits.add ( limitFromPredicate ) ; } return com.google.common.collect.Ordering.natural ( ) . min ( possibleLimits ) ; }

Target:
private int getEffectiveLimit ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p ) { java.util.List < java.lang.Integer > possibleLimits = new java.util.ArrayList < > ( 3 ) ; possibleLimits.add ( permittedLimit ) ; if ( ( limitFromCaller ) > 0 ) { possibleLimits.add ( limitFromCaller ) ; } java.lang.Integer limitFromPredicate = com.google.gerrit.server.query.change.LimitPredicate.getLimit ( p ) ; if ( limitFromPredicate != null ) { possibleLimits.add ( limitFromPredicate ) ; } return com.google.common.collect.Ordering.natural ( ) . min ( possibleLimits ) ; }
Source:
private static com.googlecode.prolog_cafe.lang.SymbolTerm getTypeSymbol ( com.google.gerrit.reviewdb.client.Patch.ChangeType type ) { switch ( type ) { case ADDED : return gerrit.PRED_commit_delta_4.add ; case MODIFIED : return gerrit.PRED_commit_delta_4.modify ; case DELETED : return gerrit.PRED_commit_delta_4.delete ; case RENAMED : return gerrit.PRED_commit_delta_4.rename ; case COPIED : return gerrit.PRED_commit_delta_4.copy ; } throw new java.lang.IllegalArgumentException ( "ChangeType not recognized" ) ; }

Target:
private static com.googlecode.prolog_cafe.lang.SymbolTerm getTypeSymbol ( com.google.gerrit.reviewdb.client.Patch.ChangeType type ) { switch ( type ) { case ADDED : return gerrit.PRED_commit_delta_4.add ; case MODIFIED : return gerrit.PRED_commit_delta_4.modify ; case DELETED : return gerrit.PRED_commit_delta_4.delete ; case RENAMED : return gerrit.PRED_commit_delta_4.rename ; case COPIED : return gerrit.PRED_commit_delta_4.copy ; case REWRITE : break ; } throw new java.lang.IllegalArgumentException ( "ChangeType not recognized" ) ; }
Source:
public static com.google.gerrit.server.index.IndexConfig create ( int maxLimit , int maxPages , int maxPrefixTerms ) { return new com.google.gerrit.server.index.AutoValue_IndexConfig ( com.google.gerrit.server.index.IndexConfig.checkLimit ( maxLimit , "maxLimit" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxPages , "maxPages" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxPrefixTerms , "maxPrefixTerms" , com.google.gerrit.server.index.IndexConfig.DEFAULT_MAX_PREFIX_TERMS ) ) ; }

Target:
public static com.google.gerrit.server.index.IndexConfig create ( int maxLimit , int maxPages , int maxTerms , int maxPrefixTerms ) { return new com.google.gerrit.server.index.AutoValue_IndexConfig ( com.google.gerrit.server.index.IndexConfig.checkLimit ( maxLimit , "maxLimit" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxPages , "maxPages" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxTerms , "maxTerms" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxPrefixTerms , "maxPrefixTerms" , com.google.gerrit.server.index.IndexConfig.DEFAULT_MAX_PREFIX_TERMS ) ) ; }
Source:
public void start ( final org.apache.sshd.server.Environment env ) { com.google.gerrit.sshd.SshScope.Context ctx = context.subContext ( newSession ( ) , context.getCommandLine ( ) ) ; final com.google.gerrit.sshd.SshScope.Context old = com.google.gerrit.sshd.SshScope.set ( ctx ) ; try { startThread ( new com.google.gerrit.sshd.CommandRunnable ( ) { @ java.lang.Override public void run ( ) throws java.lang.Exception { parseCommandLine ( ) ; com.google.gerrit.sshd.AbstractGitCommand.this . service ( ) ; } } ) ; } finally { com.google.gerrit.sshd.SshScope.set ( old ) ; } }

Target:
public Project.NameKey getProjectName ( ) { com.google.gerrit.reviewdb.Project project = projectControl.getProjectState ( ) . getProject ( ) ; return project.getNameKey ( ) ; }
Source:
private void call ( com.googlecode.prolog_cafe.lang.BufferingPrologControl env , java.lang.String name ) { com.googlecode.prolog_cafe.lang.StructureTerm head = com.googlecode.prolog_cafe.lang.SymbolTerm.create ( pkg , name , 0 ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( ( ( ( "Cannot invoke " + ( pkg ) ) + ":" ) + name ) ) . that ( env.execute ( Prolog.BUILTIN , "call" , head ) ) . isTrue ( ) ; }

Target:
private void call ( com.googlecode.prolog_cafe.lang.BufferingPrologControl env , java.lang.String name ) { com.googlecode.prolog_cafe.lang.StructureTerm head = com.googlecode.prolog_cafe.lang.SymbolTerm.create ( pkg , name , 0 ) ; com.google.common.truth.Truth.assert_ ( ) . withMessage ( ( ( ( "Cannot invoke " + ( pkg ) ) + ":" ) + name ) ) . that ( env.execute ( Prolog.BUILTIN , "call" , head ) ) . isTrue ( ) ; }
Source:
public void patchScript ( final com.google.gerrit.reviewdb.client.Patch.Key patchKey , final com.google.gerrit.reviewdb.client.PatchSet.Id psa , final com.google.gerrit.reviewdb.client.PatchSet.Id psb , final com.google.gerrit.reviewdb.client.AccountDiffPreference dp , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.PatchScript > callback ) { if ( psb == null ) { callback.onFailure ( new com.google.gerrit.common.errors.NoSuchEntityException ( ) ) ; return ; } patchScriptFactoryFactory.create ( patchKey , psa , psb , dp ) . to ( callback ) ; }

Target:
public void patchScript ( final com.google.gerrit.reviewdb.client.Patch.Key patchKey , final com.google.gerrit.reviewdb.client.PatchSet.Id psa , final com.google.gerrit.reviewdb.client.PatchSet.Id psb , final com.google.gerrit.reviewdb.client.AccountDiffPreference dp , final com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.common.data.PatchScript > callback ) { if ( psb == null ) { callback.onFailure ( new com.google.gerrit.common.errors.NoSuchEntityException ( ) ) ; return ; } patchScriptFactoryFactory.create ( patchKey , psa , psb , dp ) . to ( callback ) ; }