auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testUpdateOneConcurrentlyModifiedException ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 0 ) ; com.google.gwtorm.jdbc.JdbcAccess < com.google.gwtorm.jdbc.TestJdbcAccess.Data , com.google.gwtorm.jdbc.TestJdbcAccess.Data.DataKey > classUnderTest = createClassUnderTest ( ) ; try { classUnderTest.update ( oneRow ) ; org.junit.Assert.fail ( "missing OrmConcurrencyException" ) ; } catch ( com.google.gwtorm.server.OrmConcurrencyException e ) { } com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; }

Target:
public void testUpdateTwoConcurrentlyModifiedException ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE , 0 , 0 ) ; try { classUnderTest.update ( twoRows ) ; org.junit.Assert.fail ( "missing OrmConcurrencyException" ) ; } catch ( com.google.gwtorm.server.OrmConcurrencyException e ) { } assertCorrectUpdating ( update , 1 , 2 ) ; }
Source:
public void update ( ) { Util.ACCOUNT_SEC.mySshKeys ( new com.google.gerrit.client.rpc.GerritCallback < java.util.List < com.google.gerrit.client.reviewdb.AccountSshKey > > ( ) { public void onSuccess ( final java.util.List < com.google.gerrit.client.reviewdb.AccountSshKey > result ) { keys.display ( result ) ; keys.finishDisplay ( true ) ; } } ) ; }

Target:
public void onLoad ( ) { super . onLoad ( ) ; Util.ACCOUNT_SEC.mySshKeys ( new com.google.gerrit.client.rpc.GerritCallback < java.util.List < com.google.gerrit.client.reviewdb.AccountSshKey > > ( ) { public void onSuccess ( final java.util.List < com.google.gerrit.client.reviewdb.AccountSshKey > result ) { keys.display ( result ) ; keys.finishDisplay ( true ) ; } } ) ; }
Source:
private static boolean canCherryPick ( com.google.gerrit.server.change.RevisionResource resource ) { return ( resource.getControl ( ) . getProjectControl ( ) . canUpload ( ) ) && ( resource.isCurrent ( ) ) ; }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.RevisionResource resource ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Cherry Pick" ) . setTitle ( "Cherry pick change to a different branch" ) . setVisible ( ( ( resource.getControl ( ) . getProjectControl ( ) . canUpload ( ) ) && ( resource.isCurrent ( ) ) ) ) ; }
Source:
public void merge ( final com.google.gerrit.client.reviewdb.Branch.NameKey branch ) { if ( start ( branch ) ) { try { mergeImpl ( branch ) ; } finally { finish ( branch ) ; } } }

Target:
private void mergeImpl ( final com.google.gerrit.client.reviewdb.Branch.NameKey branch ) { try { opFactory.create ( branch ) . merge ( ) ; } catch ( java.lang.Throwable e ) { com.google.gerrit.git.ChangeMergeQueue.log.error ( ( ( "Merge attempt for " + branch ) + " failed" ) , e ) ; } finally { finish ( branch ) ; } }
Source:
public static void restore ( int id , java.lang.String path , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > cb ) { com.google.gerrit.client.changes.ChangeEditApi.Input in = com.google.gerrit.client.changes.ChangeEditApi.Input.create ( ) ; in.restorePath ( path ) ; com.google.gerrit.client.changes.ChangeApi.edit ( id ) . post ( in , cb ) ; }

Target:
public static void restore ( @ com.google.gerrit.common.Nullable java.lang.String project , int id , java.lang.String path , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > cb ) { com.google.gerrit.client.changes.ChangeEditApi.Input in = com.google.gerrit.client.changes.ChangeEditApi.Input.create ( ) ; in.restorePath ( path ) ; com.google.gerrit.client.changes.ChangeApi.edit ( project , id ) . post ( in , cb ) ; }
Source:
protected void configure ( ) { bind ( com.codahale.metrics.MetricRegistry.class ) . in ( Scopes.SINGLETON ) ; bind ( com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.class ) . in ( Scopes.SINGLETON ) ; bind ( com.google.gerrit.metrics.MetricMaker.class ) . to ( com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.class ) ; install ( new com.google.gerrit.metrics.proc.ProcMetricModule ( ) ) ; install ( new com.google.gerrit.metrics.proc.JGitMetricModule ( ) ) ; bind ( com.google.gerrit.server.cache.CacheMetrics.class ) ; }

Target:
protected void configure ( ) { bind ( com.codahale.metrics.MetricRegistry.class ) . in ( Scopes.SINGLETON ) ; bind ( com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.class ) . in ( Scopes.SINGLETON ) ; bind ( com.google.gerrit.metrics.MetricMaker.class ) . to ( com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.class ) ; install ( new com.google.gerrit.metrics.proc.ProcMetricModule ( ) ) ; install ( new com.google.gerrit.metrics.proc.JGitMetricModule ( ) ) ; }
Source:
private boolean canAddPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( ( ! ( ( refControl.asForRef ( ) . testOrFalse ( RefPermission.CREATE_CHANGE ) ) && ( getProjectControl ( ) . getProjectState ( ) . statePermitsWrite ( ) ) ) ) || ( isPatchSetLocked ( db ) ) ) { return false ; } if ( isOwner ( ) ) { return true ; } return refControl.canAddPatchSet ( ) ; }

Target:
private boolean canAddPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( ( ! ( refControl.asForRef ( ) . testOrFalse ( RefPermission.CREATE_CHANGE ) ) ) || ( isPatchSetLocked ( db ) ) ) { return false ; } if ( isOwner ( ) ) { return true ; } return refControl.canAddPatchSet ( ) ; }
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 ) ; if ( prefs.expandAllComments ( ) ) { commentManager.setExpandAllComments ( true ) ; } skipManager.render ( prefs.context ( ) , diff ) ; }

Target:
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 ) ; }
Source:
javax.servlet.http.HttpServlet getGwtUiServlet ( @ com.google.inject.name.Named ( value = com.google.gerrit.httpd.raw.StaticModule.CACHE ) com.google.common.cache.Cache < java.nio.file.Path , com.google.gerrit.httpd.raw.ResourceServlet.Resource > cache ) throws java.io.IOException { com.google.gerrit.httpd.raw.StaticModule.Paths p = getPaths ( ) ; if ( ( p.warFs ) != null ) { return new com.google.gerrit.httpd.raw.WarGwtUiServlet ( cache , p.warFs ) ; } else { return new com.google.gerrit.httpd.raw.DirectoryGwtUiServlet ( cache , p.unpackedWar , p.isDev ( ) ) ; } }

Target:
javax.servlet.http.HttpServlet getGwtUiServlet ( @ com.google.inject.name.Named ( value = com.google.gerrit.httpd.raw.StaticModule.CACHE ) com.google.common.cache.Cache < java.nio.file.Path , com.google.gerrit.httpd.raw.ResourceServlet.Resource > cache ) throws java.io.IOException { com.google.gerrit.httpd.raw.StaticModule.Paths p = getPaths ( ) ; if ( ( p.warFs ) != null ) { return new com.google.gerrit.httpd.raw.WarGwtUiServlet ( cache , p.warFs ) ; } return new com.google.gerrit.httpd.raw.DirectoryGwtUiServlet ( cache , p.unpackedWar , p.isDev ( ) ) ; }
Source:
public void createEmptyChangeOnExistingBranchWithNewBranch ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInput in = new com.google.gerrit.extensions.common.ChangeInput ( ) ; in.branch = org.eclipse.jgit.lib.Constants.MASTER ; in.subject = "Create a change on new branch from the API" ; in.project = project.get ( ) ; in.newBranch = true ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceConflictException.class ) ; com.google.gerrit.extensions.common.ChangeInfo info = gApi.changes ( ) . create ( in ) . get ( ) ; }

Target:
public void createEmptyChangeOnExistingBranchWithNewBranch ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInput in = new com.google.gerrit.extensions.common.ChangeInput ( ) ; in.branch = org.eclipse.jgit.lib.Constants.MASTER ; in.subject = "Create a change on new branch from the API" ; in.project = project.get ( ) ; in.newBranch = true ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceConflictException.class ) ; gApi.changes ( ) . create ( in ) . get ( ) ; }
Source:
public com.google.gerrit.reviewdb.client.StarredChange parse ( com.google.gerrit.server.account.AccountResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.IdentifiedUser user = parent.getUser ( ) ; try { user.asyncStarredChanges ( ) ; com.google.gerrit.server.change.ChangeResource change = changes.parse ( TopLevelResource.INSTANCE , id ) ; if ( user.getStarredChanges ( ) . contains ( change.getChange ( ) . getId ( ) ) ) { return new com.google.gerrit.server.account.AccountResource.StarredChange ( user , change ) ; } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } finally { user.abortStarredChanges ( ) ; } }

Target:
public com.google.gerrit.reviewdb.client.StarredChange parse ( com.google.gerrit.server.account.AccountResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.IdentifiedUser user = parent.getUser ( ) ; try { user.asyncStarredChanges ( ) ; com.google.gerrit.server.change.ChangeResource change = changes.parse ( TopLevelResource.INSTANCE , id ) ; if ( user.getStarredChanges ( ) . contains ( change.getId ( ) ) ) { return new com.google.gerrit.server.account.AccountResource.StarredChange ( user , change ) ; } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } finally { user.abortStarredChanges ( ) ; } }
Source:
public void onEvent ( com.google.gerrit.server.events.Event event ) { if ( ! ( publisherThread.isAlive ( ) ) ) { publisherThread.start ( ) ; } if ( ( queue.offer ( event ) ) && ( ( lostEventCount ) > 0 ) ) { com.googlesource.gerrit.plugins.rabbitmq.message.MessagePublisher.LOGGER.warn ( "Event queue is no longer full, events were lost" , lostEventCount ) ; lostEventCount = 0 ; } else if ( ( ( lostEventCount ) % 10 ) == 0 ) { com.googlesource.gerrit.plugins.rabbitmq.message.MessagePublisher.LOGGER.error ( "Event queue is full, lost event(s)" , lostEventCount ) ; } }

Target:
public void onEvent ( com.google.gerrit.server.events.Event event ) { if ( ! ( publisherThread.isAlive ( ) ) ) { publisherThread.start ( ) ; } if ( queue.offer ( event ) ) { if ( ( lostEventCount ) > 0 ) { com.googlesource.gerrit.plugins.rabbitmq.message.MessagePublisher.LOGGER.warn ( "Event queue is no longer full, events were lost" , lostEventCount ) ; lostEventCount = 0 ; } } else { if ( ( ( ( lostEventCount ) ++ ) % 10 ) == 0 ) { com.googlesource.gerrit.plugins.rabbitmq.message.MessagePublisher.LOGGER.error ( "Event queue is full, lost event(s)" , lostEventCount ) ; } } }
Source:
private void goUpToChange ( boolean openReplyBox ) { java.lang.String b = ( ( base ) != null ) ? java.lang.String.valueOf ( base.get ( ) ) : null ; java.lang.String rev = java.lang.String.valueOf ( revision.get ( ) ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId , rev ) , new com.google.gerrit.client.change.ChangeScreen2 ( changeId , b , rev , openReplyBox ) ) ; }

Target:
private void goUpToChange ( boolean openReplyBox ) { java.lang.String b = ( ( base ) != null ) ? java.lang.String.valueOf ( base.get ( ) ) : null ; java.lang.String rev = java.lang.String.valueOf ( revision.get ( ) ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId , rev ) , new com.google.gerrit.client.change.ChangeScreen2 ( changeId , b , rev , openReplyBox , false ) ) ; }
Source:
public void destroy ( ) { java.util.concurrent.Future < ? > future = task.getAndSet ( null ) ; if ( future != null ) { future.cancel ( true ) ; destroyExecutor.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { onDestroy ( ) ; } } ) ; } }

Target:
public void destroy ( ) { java.util.concurrent.Future < ? > future = task.getAndSet ( null ) ; if ( future != null ) { future.cancel ( true ) ; destroyExecutor.execute ( this :: onDestroy ) ; } }
Source:
public com.google.common.base.Optional < com.googlesource.gerrit.plugins.manager.gson.SmartJson > getOptional ( java.lang.String fieldName ) { if ( ( ( jsonElem ) != null ) && ( ( jsonElem.getAsJsonObject ( ) . get ( fieldName ) ) != null ) ) { return com.google.common.base.Optional.of ( com.googlesource.gerrit.plugins.manager.gson.SmartJson.of ( jsonElem.getAsJsonObject ( ) . get ( fieldName ) ) ) ; } return com.google.common.base.Optional.absent ( ) ; }

Target:
public com.google.common.base.Optional < com.googlesource.gerrit.plugins.manager.gson.SmartJson > getOptional ( java.lang.String fieldName ) { if ( ( ( jsonElem ) != null ) && ( ( jsonElem.getAsJsonObject ( ) . get ( fieldName ) ) != null ) ) { return com.google.common.base.Optional.of ( com.googlesource.gerrit.plugins.manager.gson.SmartJson.of ( jsonElem.getAsJsonObject ( ) . get ( fieldName ) ) ) ; } else { return com.google.common.base.Optional.absent ( ) ; } }
Source:
private org.eclipse.jgit.internal.storage.file.LockFile lockForImport ( ) throws com.google.gerrit.extensions.restapi.ResourceConflictException { java.io.File importStatus = projects.FS_LAYOUT.getImportStatusFile ( targetProject.get ( ) ) ; org.eclipse.jgit.internal.storage.file.LockFile lockFile = new org.eclipse.jgit.internal.storage.file.LockFile ( importStatus ) ; try { if ( lockFile.lock ( ) ) { return lockFile ; } else { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "project is being imported from another session" ) ; } } catch ( java.io.IOException e1 ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "failed to lock project for import" ) ; } }

Target:
private org.eclipse.jgit.internal.storage.file.LockFile lockForImport ( ) throws com.google.gerrit.extensions.restapi.ResourceConflictException { java.io.File importStatus = projects.FS_LAYOUT.getImportStatusFile ( targetProject.get ( ) ) ; org.eclipse.jgit.internal.storage.file.LockFile lockFile = new org.eclipse.jgit.internal.storage.file.LockFile ( importStatus ) ; try { if ( lockFile.lock ( ) ) { return lockFile ; } throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "project is being imported from another session" ) ; } catch ( java.io.IOException e1 ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "failed to lock project for import" ) ; } }
Source:
public void deleteReviewerFromReviewableChangeNotifyOwnerReviewers ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; removeReviewer ( sc , extraReviewer , NotifyHandling.OWNER_REVIEWERS ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . notTo ( sc.owner ) . to ( extraReviewer ) . to ( sc.reviewerByEmail ) . cc ( extraCcer , sc.reviewer , sc.ccer ) . cc ( sc.ccerByEmail ) . notTo ( sc.starrer ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteReviewerFromReviewableChangeNotifyOwnerReviewers ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; removeReviewer ( sc , extraReviewer , NotifyHandling.OWNER_REVIEWERS ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . notTo ( sc.owner ) . to ( extraReviewer ) . cc ( extraCcer , sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( sc.starrer ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }
Source:
private com.google.gerrit.server.events.AccountAttribute asAccountAttribute ( com.google.gerrit.reviewdb.client.Account.Id user ) { com.google.gerrit.server.events.AccountAttribute a = accounts.get ( user ) ; if ( a == null ) { a = new com.google.gerrit.server.events.AccountAttribute ( ) ; accounts.put ( user , a ) ; } return a ; }

Target:
private com.google.gerrit.server.events.AccountAttribute asAccountAttribute ( com.google.gerrit.reviewdb.client.Account.Id user ) { if ( user == null ) { return null ; } com.google.gerrit.server.events.AccountAttribute a = accounts.get ( user ) ; if ( a == null ) { a = new com.google.gerrit.server.events.AccountAttribute ( ) ; accounts.put ( user , a ) ; } return a ; }
Source:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > files ( java.lang.String base ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return ( ( java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > ) ( listFiles.get ( ) . setBase ( base ) . apply ( revision ) . value ( ) ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve files" , e ) ; } }

Target:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > files ( java.lang.String base ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return ( ( java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > ) ( listFiles.setBase ( base ) . apply ( revision ) . value ( ) ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve files" , e ) ; } }
Source:
static com.google.gerrit.server.index.FieldDef < com.google.gerrit.server.query.change.ChangeData , ? > commitField ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema , java.lang.String id ) { if ( ( ( id.length ( ) ) == ( org.eclipse.jgit.lib.Constants.OBJECT_ID_STRING_LENGTH ) ) && ( schema.hasField ( com.google.gerrit.server.index.ChangeField.EXACT_COMMIT ) ) ) { return com.google.gerrit.server.index.ChangeField.EXACT_COMMIT ; } return com.google.gerrit.server.index.ChangeField.COMMIT ; }

Target:
static com.google.gerrit.server.index.FieldDef < com.google.gerrit.server.query.change.ChangeData , ? > commitField ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema , java.lang.String id ) { if ( ( ( ( id.length ( ) ) == ( org.eclipse.jgit.lib.Constants.OBJECT_ID_STRING_LENGTH ) ) && ( schema != null ) ) && ( schema.hasField ( com.google.gerrit.server.index.ChangeField.EXACT_COMMIT ) ) ) { return com.google.gerrit.server.index.ChangeField.EXACT_COMMIT ; } return com.google.gerrit.server.index.ChangeField.COMMIT ; }
Source:
protected java.util.List < com.google.gerrit.reviewdb.client.Change > impl ( com.google.gerrit.server.util.RequestContext ctx ) throws com.google.gwtorm.server.OrmException { java.lang.String ref = event.getRefName ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey project = new com.google.gerrit.reviewdb.client.Project.NameKey ( event.getProjectName ( ) ) ; if ( ref.equals ( RefNames.REFS_CONFIG ) ) { return com.google.gerrit.server.query.change.ChangeData.asChanges ( queryProvider.get ( ) . byProjectOpen ( project ) ) ; } else { return com.google.gerrit.server.query.change.ChangeData.asChanges ( queryProvider.get ( ) . byBranchOpen ( new com.google.gerrit.reviewdb.client.Branch.NameKey ( project , ref ) ) ) ; } }

Target:
protected java.util.List < com.google.gerrit.reviewdb.client.Change > impl ( com.google.gerrit.server.util.RequestContext ctx ) throws com.google.gwtorm.server.OrmException { java.lang.String ref = event.getRefName ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey project = new com.google.gerrit.reviewdb.client.Project.NameKey ( event.getProjectName ( ) ) ; if ( ref.equals ( RefNames.REFS_CONFIG ) ) { return com.google.gerrit.server.query.change.ChangeData.asChanges ( queryProvider.get ( ) . byProjectOpen ( project ) ) ; } return com.google.gerrit.server.query.change.ChangeData.asChanges ( queryProvider.get ( ) . byBranchOpen ( new com.google.gerrit.reviewdb.client.Branch.NameKey ( project , ref ) ) ) ; }
Source:
private void initProjectLinks ( final com.google.gerrit.client.changes.ChangeInfo info ) { projectSettings.addDomHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toProject ( info.project_name_key ( ) ) ) ; } } , com.google.gwt.event.dom.client.ClickEvent.getType ( ) ) ; projectLink.setText ( info.project ( ) ) ; projectLink.setTargetHistoryToken ( com.google.gerrit.common.PageLinks.toProjectDefaultDashboard ( info.project_name_key ( ) ) ) ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toProjectDefaultDashboard ( info.project_name_key ( ) ) ) ; }
Source:
private PushOneCommit.Result createChange ( org.eclipse.jgit.api.Git git , boolean conflicting ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.GitUtil.checkout ( git , "origin/master" ) ; java.lang.String file = ( conflicting ) ? "test.txt" : ( "test-" + ( count ) ) + ".txt" ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , ( "Change " + ( count ) ) , file , ( "content " + ( count ) ) ) ; ( count ) ++ ; return push.to ( git , "refs/for/master" ) ; }

Target:
private PushOneCommit.Result createChange ( org.eclipse.jgit.api.Git git , boolean conflicting ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.GitUtil.checkout ( git , "origin/master" ) ; java.lang.String file = ( conflicting ) ? "test.txt" : ( "test-" + ( count ) ) + ".txt" ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , git , ( "Change " + ( count ) ) , file , ( "content " + ( count ) ) ) ; ( count ) ++ ; return push.to ( "refs/for/master" ) ; }
Source:
public com.google.gerrit.extensions.common.EditInfo toEditInfo ( com.google.gerrit.server.edit.ChangeEdit edit , boolean downloadCommands ) { com.google.gerrit.extensions.common.EditInfo out = new com.google.gerrit.extensions.common.EditInfo ( ) ; out.commit = com.google.gerrit.server.edit.ChangeEditJson.fillCommit ( edit.getEditCommit ( ) ) ; out.baseRevision = edit.getBasePatchSet ( ) . getRevision ( ) . get ( ) ; out.actions = com.google.gerrit.server.edit.ChangeEditJson.fillActions ( edit ) ; if ( downloadCommands ) { out.fetch = fillFetchMap ( edit ) ; } return out ; }

Target:
public com.google.gerrit.extensions.common.EditInfo toEditInfo ( com.google.gerrit.server.edit.ChangeEdit edit , boolean downloadCommands ) { com.google.gerrit.extensions.common.EditInfo out = new com.google.gerrit.extensions.common.EditInfo ( ) ; out.commit = com.google.gerrit.server.edit.ChangeEditJson.fillCommit ( edit.getEditCommit ( ) ) ; out.baseRevision = edit.getBasePatchSet ( ) . getRevision ( ) . get ( ) ; if ( downloadCommands ) { out.fetch = fillFetchMap ( edit ) ; } return out ; }
Source:
public boolean canUpdate ( ) { if ( ( RefNames.REFS_CONFIG.equals ( refName ) ) && ( ! ( projectControl.isOwner ( ) ) ) ) { if ( ! ( ( projectControl.getProjectState ( ) . isAllProjects ( ) ) && ( getUser ( ) . getCapabilities ( ) . isAdmin_DoNotUse ( ) ) ) ) { return false ; } } return ( canPerform ( Permission.PUSH ) ) && ( canWrite ( ) ) ; }

Target:
private boolean canUpdate ( ) { if ( ( RefNames.REFS_CONFIG.equals ( refName ) ) && ( ! ( projectControl.isOwner ( ) ) ) ) { if ( ! ( ( projectControl.getProjectState ( ) . isAllProjects ( ) ) && ( getUser ( ) . getCapabilities ( ) . isAdmin_DoNotUse ( ) ) ) ) { return false ; } } return ( canPerform ( Permission.PUSH ) ) && ( canWrite ( ) ) ; }
Source:
public void initFs ( ) throws java.io.IOException { uuid.initFs ( java.util.UUID.randomUUID ( ) . toString ( ) ) ; head.initFs ( ( ( long ) ( 0 ) ) ) ; tail.initFs ( ( ( long ) ( 1 ) ) ) ; }

Target:
public void initFs ( ) throws java.io.IOException { uuid.initFs ( ) ; head.initFs ( ( ( long ) ( 0 ) ) ) ; tail.initFs ( ( ( long ) ( 1 ) ) ) ; }
Source:
public < V > void newCallbackMetric ( java.lang.String name , java.lang.Class < V > valueClass , com.google.gerrit.metrics.Description desc , final com.google.common.base.Supplier < V > trigger ) { final com.google.gerrit.metrics.CallbackMetric0 < V > metric = newCallbackMetric ( name , valueClass , desc ) ; newTrigger ( metric , new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { metric.set ( trigger.get ( ) ) ; } } ) ; }

Target:
public < V > void newCallbackMetric ( java.lang.String name , java.lang.Class < V > valueClass , com.google.gerrit.metrics.Description desc , com.google.common.base.Supplier < V > trigger ) { com.google.gerrit.metrics.CallbackMetric0 < V > metric = newCallbackMetric ( name , valueClass , desc ) ; newTrigger ( metric , ( ) -> { metric.set ( trigger.get ( ) ) ; } ) ; }
Source:
public void parse ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { raw = reader.open ( noteId , org.eclipse.jgit.lib.Constants.OBJ_BLOB ) . getCachedBytes ( com.google.gerrit.server.notedb.RevisionNote.MAX_NOTE_SZ ) ; org.eclipse.jgit.util.MutableInteger p = new org.eclipse.jgit.util.MutableInteger ( ) ; com.google.gerrit.server.notedb.RevisionNote.trimLeadingEmptyLines ( raw , p ) ; if ( ( p.value ) >= ( raw.length ) ) { comments = null ; return ; } comments = com.google.common.collect.ImmutableList.copyOf ( parse ( raw , p.value ) ) ; }

Target:
public void parse ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { raw = reader.open ( noteId , org.eclipse.jgit.lib.Constants.OBJ_BLOB ) . getCachedBytes ( com.google.gerrit.server.notedb.RevisionNote.MAX_NOTE_SZ ) ; org.eclipse.jgit.util.MutableInteger p = new org.eclipse.jgit.util.MutableInteger ( ) ; com.google.gerrit.server.notedb.RevisionNote.trimLeadingEmptyLines ( raw , p ) ; if ( ( p.value ) >= ( raw.length ) ) { comments = com.google.common.collect.ImmutableList.of ( ) ; return ; } comments = com.google.common.collect.ImmutableList.copyOf ( parse ( raw , p.value ) ) ; }
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 add ( 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 ( k ) ; } }
Source:
public com.google.gerrit.extensions.api.changes.ChangeApi cherryPick ( com.google.gerrit.extensions.api.changes.CherryPickInput in ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return changes.id ( cherryPick.get ( ) . apply ( revision , in ) . _number ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot cherry pick" , e ) ; } catch ( com.google.gerrit.common.errors.EmailException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot cherry pick" , e ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot cherry pick" , e ) ; } }

Target:
public com.google.gerrit.extensions.api.changes.ChangeApi cherryPick ( com.google.gerrit.extensions.api.changes.CherryPickInput in ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return changes.id ( cherryPick.get ( ) . apply ( revision , in ) . _number ) ; } catch ( com.google.gwtorm.server.OrmException | com.google.gerrit.common.errors.EmailException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot cherry pick" , e ) ; } }
Source:
public com.google.gerrit.extensions.api.changes.ChangeApi revert ( com.google.gerrit.extensions.api.changes.RevertInput in ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return changeApi.id ( revert.get ( ) . apply ( change , in ) . _number ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot revert change" , e ) ; } catch ( com.google.gerrit.common.errors.EmailException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot revert change" , e ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot revert change" , e ) ; } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot revert change" , e ) ; } }

Target:
public com.google.gerrit.extensions.api.changes.ChangeApi revert ( com.google.gerrit.extensions.api.changes.RevertInput in ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return changeApi.id ( revert.get ( ) . apply ( change , in ) . _number ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot revert change" , e ) ; } catch ( com.google.gerrit.common.errors.EmailException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot revert change" , e ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot revert change" , e ) ; } }
Source:
public void testCreateProjectApi ( ) throws java.lang.Exception { final java.lang.String newProjectName = "newProject" ; com.google.gerrit.extensions.common.ProjectInfo p = gApi.projects ( ) . name ( newProjectName ) . create ( ) . get ( ) ; com.google.common.truth.Truth.assertThat ( p.name ) . isEqualTo ( newProjectName ) ; com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( newProjectName ) ) ; com.google.common.truth.Truth.assertThat ( projectState ) . isNotNull ( ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjectInfo ( projectState.getProject ( ) , p ) ; assertHead ( newProjectName , "refs/heads/master" ) ; }

Target:
public void testCreateProjectApi ( ) throws java.lang.Exception { final java.lang.String newProjectName = "newProject" ; com.google.gerrit.extensions.common.ProjectInfo p = gApi.projects ( ) . create ( newProjectName ) . get ( ) ; com.google.common.truth.Truth.assertThat ( p.name ) . isEqualTo ( newProjectName ) ; com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( newProjectName ) ) ; com.google.common.truth.Truth.assertThat ( projectState ) . isNotNull ( ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjectInfo ( projectState.getProject ( ) , p ) ; assertHead ( newProjectName , "refs/heads/master" ) ; }
Source:
public void printJson ( final java.lang.StringBuffer sb , final java.util.List < T > o ) { if ( o != null ) { sb.append ( '[' ) ; boolean first = true ; for ( final T item : o ) { if ( first ) { first = false ; } else { sb.append ( ',' ) ; } serializer.printJson ( sb , item ) ; } sb.append ( ']' ) ; } else { sb.append ( com.google.gwtjsonrpc.client.JS_NULL ) ; } }

Target:
public void printJson ( final java.lang.StringBuffer sb , final java.util.List < T > o ) { sb.append ( '[' ) ; boolean first = true ; for ( final T item : o ) { if ( first ) { first = false ; } else { sb.append ( ',' ) ; } if ( item != null ) { serializer.printJson ( sb , item ) ; } else { sb.append ( com.google.gwtjsonrpc.client.JS_NULL ) ; } } sb.append ( ']' ) ; }
Source:
private void setRulesPl ( java.lang.String rule ) throws java.lang.Exception { com.google.gerrit.server.git.MetaDataUpdate md = metaDataUpdateFactory.create ( project ) ; try { com.google.gerrit.acceptance.api.change.SubmitTypeRuleIT.RulesPl r = new com.google.gerrit.acceptance.api.change.SubmitTypeRuleIT.RulesPl ( ) ; r.load ( md ) ; r.rule = rule ; r.commit ( md ) ; } finally { md.close ( ) ; } }

Target:
private void setRulesPl ( java.lang.String rule ) throws java.lang.Exception { try ( com.google.gerrit.server.git.MetaDataUpdate md = metaDataUpdateFactory.create ( project ) ) { com.google.gerrit.acceptance.api.change.SubmitTypeRuleIT.RulesPl r = new com.google.gerrit.acceptance.api.change.SubmitTypeRuleIT.RulesPl ( ) ; r.load ( md ) ; r.rule = rule ; r.commit ( md ) ; } }
Source:
protected void insert ( final int row , final com.google.gerrit.client.projects.ProjectInfo k ) { table.insertRow ( row ) ; applyDataRowStyle ( row ) ; final com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter fmt = table.getFlexCellFormatter ( ) ; fmt.addStyleName ( row , 1 , Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; fmt.addStyleName ( row , 1 , Gerrit.RESOURCES.css ( ) . cPROJECT ( ) ) ; fmt.addStyleName ( row , 2 , Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; populate ( row , k ) ; }

Target:
protected void insert ( final int row , final com.google.gerrit.client.projects.ProjectInfo k ) { table.insertRow ( row ) ; applyDataRowStyle ( row ) ; final com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter fmt = table.getFlexCellFormatter ( ) ; fmt.addStyleName ( row , 1 , Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; fmt.addStyleName ( row , 2 , Gerrit.RESOURCES.css ( ) . dataCell ( ) ) ; populate ( row , k ) ; }
Source:
public void execute ( java.lang.String issue , com.googlesource.gerrit.plugins.its.base.workflow.ActionRequest actionRequest , java.util.Set < com.googlesource.gerrit.plugins.its.base.workflow.Property > properties ) throws java.io.IOException { java.lang.String [ ] parameters = actionRequest.getParameters ( ) ; java.lang.String comment = org.apache.commons.lang.StringUtils.join ( parameters , " " ) ; if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( comment ) ) ) { its.addComment ( issue , comment ) ; } }

Target:
public void execute ( java.lang.String issue , com.googlesource.gerrit.plugins.its.base.workflow.ActionRequest actionRequest , java.util.Set < com.googlesource.gerrit.plugins.its.base.workflow.Property > properties ) throws java.io.IOException { java.lang.String comment = java.lang.String.join ( " " , actionRequest.getParameters ( ) ) ; if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( comment ) ) ) { its.addComment ( issue , comment ) ; } }
Source:
public void doPost ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { try { doAuth ( req , rsp ) ; } catch ( java.lang.Exception e ) { getServletContext ( ) . log ( "Unexpected error during authentication" , e ) ; finishLogin ( rsp , null , null ) ; } }

Target:
public void doPost ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { try { doAuth ( req , rsp ) ; } catch ( java.lang.Exception e ) { getServletContext ( ) . log ( "Unexpected error during authentication" , e ) ; finishLogin ( req , rsp , null , null ) ; } }
Source:
public com.google.gerrit.server.account.GroupControl controlFor ( final com.google.gerrit.reviewdb.AccountGroup.Id groupId ) throws com.google.gerrit.common.errors.NoSuchGroupException { final com.google.gerrit.reviewdb.AccountGroup group = groupCache.get ( groupId ) ; if ( group == null ) { throw new com.google.gerrit.common.errors.NoSuchGroupException ( groupId ) ; } return new com.google.gerrit.server.account.GroupControl ( user.get ( ) , group ) ; }

Target:
public com.google.gerrit.server.account.GroupControl controlFor ( final com.google.gerrit.reviewdb.AccountGroup.Id groupId ) throws com.google.gerrit.common.errors.NoSuchGroupException { final com.google.gerrit.reviewdb.AccountGroup group = groupCache.get ( groupId ) ; if ( group == null ) { throw new com.google.gerrit.common.errors.NoSuchGroupException ( groupId ) ; } return new com.google.gerrit.server.account.GroupControl ( groupCache , user.get ( ) , group ) ; }
Source:
private com.google.gerrit.server.data.DependencyAttribute newDependencyAttribute ( com.google.gerrit.reviewdb.client.Change c , com.google.gerrit.reviewdb.client.PatchSet ps ) { com.google.gerrit.server.data.DependencyAttribute d = new com.google.gerrit.server.data.DependencyAttribute ( ) ; d.number = c.getId ( ) . toString ( ) ; d.id = c.getKey ( ) . toString ( ) ; d.revision = ps.getRevision ( ) . get ( ) ; d.ref = ps.getRefName ( ) ; return d ; }

Target:
private com.google.gerrit.server.data.DependencyAttribute newDependencyAttribute ( com.google.gerrit.reviewdb.client.Change c , com.google.gerrit.reviewdb.client.PatchSet ps ) { com.google.gerrit.server.data.DependencyAttribute d = new com.google.gerrit.server.data.DependencyAttribute ( ) ; d.number = c.getId ( ) . get ( ) ; d.id = c.getKey ( ) . toString ( ) ; d.revision = ps.getRevision ( ) . get ( ) ; d.ref = ps.getRefName ( ) ; return d ; }
Source:
protected com.google.gerrit.reviewdb.client.Change newChange ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , changeOwner.getAccountId ( ) ) ; com.google.gerrit.server.notedb.ChangeUpdate u = newUpdate ( c , changeOwner ) ; u.setSubject ( c.getSubject ( ) ) ; u.setBranch ( c.getDest ( ) . get ( ) ) ; u.commit ( ) ; return c ; }

Target:
protected com.google.gerrit.reviewdb.client.Change newChange ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , changeOwner.getAccountId ( ) ) ; com.google.gerrit.server.notedb.ChangeUpdate u = newUpdate ( c , changeOwner ) ; u.setBranch ( c.getDest ( ) . get ( ) ) ; u.commit ( ) ; return c ; }
Source:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { init ( ) ; validate ( ) ; patchSetInfo = patchSetInfoFactory.get ( ctx.getRevWalk ( ) , commit , psId ) ; ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) , commit , getPatchSetId ( ) . toRefName ( ) , ReceiveCommand.Type.CREATE ) ) ; }

Target:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { init ( ) ; validate ( ctx ) ; patchSetInfo = patchSetInfoFactory.get ( ctx.getRevWalk ( ) , commit , psId ) ; ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) , commit , getPatchSetId ( ) . toRefName ( ) , ReceiveCommand.Type.CREATE ) ) ; }
Source:
public com.google.gerrit.server.change.ReviewerJson.ReviewerInfo format ( com.google.gerrit.server.change.ReviewerJson.ReviewerInfo out , com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.server.notedb.ChangeNotes changeNotes ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet.Id psId = ctl.getChange ( ) . currentPatchSetId ( ) ; return format ( out , ctl , approvalsUtil.byPatchSetUser ( db.get ( ) , changeNotes , psId , out._id ) ) ; }

Target:
public com.google.gerrit.server.change.ReviewerJson.ReviewerInfo format ( com.google.gerrit.server.change.ReviewerJson.ReviewerInfo out , com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.server.notedb.ChangeNotes changeNotes ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet.Id psId = ctl.getChange ( ) . currentPatchSetId ( ) ; return format ( out , ctl , approvalsUtil.byPatchSetUser ( db.get ( ) , ctl , psId , out._id ) ) ; }
Source:
public void fooSubdirJson ( ) throws java.lang.Exception { java.util.Map < java.lang.String , com.google.gitiles.RepositoryDescription > res = buildJson ( "/foo/" , com.google.gitiles.HostIndexServletTest.REPOS ) ; com.google.common.truth.Truth.assertThat ( res ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( res ) . containsKey ( "bar/repo" ) ; com.google.gitiles.RepositoryDescription d = res.get ( "bar/repo" ) ; com.google.common.truth.Truth.assertThat ( d.name ) . isEqualTo ( repo.getRepository ( ) . getDescription ( ) . getRepositoryName ( ) ) ; }

Target:
public void fooSubdirJson ( ) throws java.lang.Exception { java.util.Map < java.lang.String , com.google.gitiles.RepositoryDescription > res = buildJson ( com.google.gitiles.HostIndexServletTest.REPOS , "/foo/" ) ; com.google.common.truth.Truth.assertThat ( res ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( res ) . containsKey ( "bar/repo" ) ; com.google.gitiles.RepositoryDescription d = res.get ( "bar/repo" ) ; com.google.common.truth.Truth.assertThat ( d.name ) . isEqualTo ( repo.getRepository ( ) . getDescription ( ) . getRepositoryName ( ) ) ; }
Source:
public static synchronized void schedule ( final com.google.gerrit.client.reviewdb.Branch.NameKey branch ) { com.google.gerrit.git.MergeQueue.MergeEntry e = com.google.gerrit.git.MergeQueue.active.get ( branch ) ; if ( e == null ) { e = new com.google.gerrit.git.MergeQueue.MergeEntry ( branch ) ; com.google.gerrit.git.MergeQueue.active.put ( branch , e ) ; } e.needMerge = true ; com.google.gerrit.git.MergeQueue.scheduleJobImp ( e ) ; }

Target:
void schedule ( com.google.gerrit.client.reviewdb.Branch.NameKey branch ) ;
Source:
public void createProjectDuplicate ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.name = "baz" ; gApi.projects ( ) . name ( "baz" ) . create ( in ) ; gApi.projects ( ) . name ( "baz" ) . create ( in ) ; }

Target:
public void createProjectDuplicate ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.name = "baz" ; gApi.projects ( ) . create ( in ) ; gApi.projects ( ) . create ( in ) ; }
Source:
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 ) ; } }

Target:
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 ) ; } }
Source:
protected void preInvoke ( final com.google.gerrit.httpd.rpc.GerritJsonServlet.GerritCall call ) { super . preInvoke ( call ) ; if ( call.isComplete ( ) ) { return ; } if ( ( call.getMethod ( ) . getAnnotation ( com.google.gerrit.common.auth.SignInRequired.class ) ) != null ) { if ( ( ! ( call.requireXsrfValid ( ) ) ) || ( ! ( session.get ( ) . isSignedIn ( ) ) ) ) { call.onFailure ( new com.google.gerrit.common.errors.NotSignedInException ( ) ) ; return ; } } }

Target:
protected void preInvoke ( final com.google.gerrit.httpd.rpc.GerritJsonServlet.GerritCall call ) { super . preInvoke ( call ) ; if ( call.isComplete ( ) ) { return ; } if ( ( call.getMethod ( ) . getAnnotation ( com.google.gerrit.common.auth.SignInRequired.class ) ) != null ) { if ( ( ! ( call.requireXsrfValid ( ) ) ) || ( ! ( session.get ( ) . isSignedIn ( ) ) ) ) { call.onFailure ( new com.google.gerrit.common.errors.NotSignedInException ( ) ) ; } } }
Source:
public com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > rewrite ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in , com.google.gerrit.server.index.QueryOptions opts ) throws com.google.gerrit.server.query.QueryParseException { com.google.gerrit.server.index.change.ChangeIndex index = indexes.getSearchIndex ( ) ; org.eclipse.jgit.util.MutableInteger leafTerms = new org.eclipse.jgit.util.MutableInteger ( ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewriteImpl ( in , index , opts , leafTerms ) ; if ( ( in == out ) || ( out instanceof com.google.gerrit.server.index.IndexPredicate ) ) { return new com.google.gerrit.server.index.change.IndexedChangeQuery ( index , out , opts ) ; } else if ( out == null ) { return in ; } else { return out ; } }

Target:
private com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > rewriteImpl ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in , com.google.gerrit.server.index.QueryOptions opts ) throws com.google.gerrit.server.query.QueryParseException { com.google.gerrit.server.index.change.ChangeIndex index = indexes.getSearchIndex ( ) ; org.eclipse.jgit.util.MutableInteger leafTerms = new org.eclipse.jgit.util.MutableInteger ( ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewriteImpl ( in , index , opts , leafTerms ) ; if ( ( in == out ) || ( out instanceof com.google.gerrit.server.index.IndexPredicate ) ) { return new com.google.gerrit.server.index.change.IndexedChangeQuery ( index , out , opts ) ; } else if ( out == null ) { return in ; } else { return out ; } }
Source:
public static boolean canRead ( final com.google.gerrit.client.reviewdb.Account.Id who , final com.google.gerrit.client.reviewdb.Project.NameKey projectKey ) { final com.google.gerrit.client.data.ProjectCache.Entry e = com.google.gerrit.client.rpc.Common.getProjectCache ( ) . get ( projectKey ) ; if ( e == null ) { return false ; } final java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > myGroups = com.google.gerrit.client.rpc.Common.getGroupCache ( ) . getEffectiveGroups ( who ) ; return com.google.gerrit.client.rpc.BaseServiceImplementation.canPerform ( myGroups , e , ApprovalCategory.READ , ( ( short ) ( 1 ) ) , true ) ; }

Target:
public static boolean canRead ( final com.google.gerrit.client.reviewdb.Account.Id who , final com.google.gerrit.client.reviewdb.Project.NameKey projectKey ) { final com.google.gerrit.client.data.ProjectCache.Entry e = com.google.gerrit.client.rpc.Common.getProjectCache ( ) . get ( projectKey ) ; return com.google.gerrit.client.rpc.BaseServiceImplementation.canRead ( who , e ) ; }