auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testExecuteItemException ( ) throws java.io.IOException { com.googlesource.gerrit.plugins.hooks.workflow.ActionRequest actionRequest = createMock ( com.googlesource.gerrit.plugins.hooks.workflow.ActionRequest.class ) ; org.easymock.EasyMock.expect ( actionRequest.getUnparsed ( ) ) . andReturn ( "unparsed action 1" ) ; its.performAction ( "4711" , "unparsed action 1" ) ; org.easymock.EasyMock.expectLastCall ( ) . andThrow ( new java.io.IOException ( "injected exception 1" ) ) ; replayMocks ( ) ; com.googlesource.gerrit.plugins.hooks.workflow.ActionExecutor actionExecutor = createActionExecutor ( ) ; actionExecutor.execute ( "4711" , actionRequest ) ; assertLogThrowableMessageContains ( "injected exception 1" ) ; }

Target:
public void testExecuteItem ( ) throws java.io.IOException { com.googlesource.gerrit.plugins.hooks.workflow.ActionRequest actionRequest = createMock ( com.googlesource.gerrit.plugins.hooks.workflow.ActionRequest.class ) ; org.easymock.EasyMock.expect ( actionRequest.getName ( ) ) . andReturn ( "unparsed" ) ; org.easymock.EasyMock.expect ( actionRequest.getUnparsed ( ) ) . andReturn ( "unparsed action 1" ) ; java.util.Set < com.googlesource.gerrit.plugins.hooks.workflow.Property > properties = java.util.Collections.emptySet ( ) ; its.performAction ( "4711" , "unparsed action 1" ) ; replayMocks ( ) ; com.googlesource.gerrit.plugins.hooks.workflow.ActionExecutor actionExecutor = createActionExecutor ( ) ; actionExecutor.execute ( "4711" , actionRequest , properties ) ; }
Source:
public com.google.gerrit.server.IdentifiedUser parse ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.UnprocessableEntityException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.IdentifiedUser user = parseId ( id ) ; if ( user == null ) { throw new com.google.gerrit.extensions.restapi.UnprocessableEntityException ( java.lang.String.format ( "Account Not Found: %s" , id ) ) ; } else if ( ! ( accountControlFactory.get ( ) . canSee ( user.getAccount ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.UnprocessableEntityException ( java.lang.String.format ( "Account Not Found: %s" , id ) ) ; } return user ; }

Target:
public com.google.gerrit.server.IdentifiedUser parse ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.UnprocessableEntityException , com.google.gwtorm.server.OrmException { return parseOnBehalfOf ( null , id ) ; }
Source:
public org.eclipse.jgit.lib.Repository createRepository ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws com.google.gerrit.server.git.RepositoryCaseMismatchException , org.eclipse.jgit.errors.RepositoryNotFoundException { org.eclipse.jgit.lib.Repository repo = createRepository ( basePath , name ) ; if ( ( noteDbPath ) != null ) { createRepository ( noteDbPath , name ) ; } return repo ; }

Target:
public org.eclipse.jgit.lib.Repository createRepository ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws com.google.gerrit.server.git.RepositoryCaseMismatchException , org.eclipse.jgit.errors.RepositoryNotFoundException { org.eclipse.jgit.lib.Repository repo = createRepository ( getBasePath ( name ) , name ) ; if ( ( notesMigration.writeChanges ( ) ) && ( ! ( noteDbPath.equals ( basePath ) ) ) ) { createRepository ( noteDbPath , name ) ; } return repo ; }
Source:
private com.google.gerrit.server.events.ApprovalAttribute getApprovalAttribute ( com.google.gerrit.common.data.LabelTypes labelTypes , java.util.Map.Entry < java.lang.String , java.lang.Short > approval ) { com.google.gerrit.server.events.ApprovalAttribute a = new com.google.gerrit.server.events.ApprovalAttribute ( ) ; a.type = approval.getKey ( ) ; com.google.gerrit.common.data.LabelType lt = labelTypes.byLabel ( approval.getKey ( ) ) ; if ( lt != null ) { a.description = lt.getName ( ) ; } a.value = java.lang.Short.toString ( approval.getValue ( ) ) ; return a ; }

Target:
private com.google.gerrit.server.data.ApprovalAttribute getApprovalAttribute ( com.google.gerrit.common.data.LabelTypes labelTypes , java.util.Map.Entry < java.lang.String , java.lang.Short > approval ) { com.google.gerrit.server.data.ApprovalAttribute a = new com.google.gerrit.server.data.ApprovalAttribute ( ) ; a.type = approval.getKey ( ) ; com.google.gerrit.common.data.LabelType lt = labelTypes.byLabel ( approval.getKey ( ) ) ; if ( lt != null ) { a.description = lt.getName ( ) ; } a.value = java.lang.Short.toString ( approval.getValue ( ) ) ; return a ; }
Source:
public void testFindInInsertGap ( ) { com.google.gerrit.client.diff.LineMapper mapper = new com.google.gerrit.client.diff.LineMapper ( ) ; mapper.appendInsert ( 10 ) ; org.junit.Assert.assertEquals ( ( - 1 ) , mapper.lineOnOther ( Side.REVISION , 9 ) ) ; }

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 ( Side.PARENT , 10 ) ) ; org.junit.Assert.assertEquals ( new com.google.gerrit.client.diff.LineMapper.LineOnOtherInfo ( 10 , true ) , mapper.lineOnOther ( Side.REVISION , 10 ) ) ; }
Source:
private org.eclipse.jgit.lib.PersonIdent newAuthorIdent ( ) { com.google.gerrit.server.CurrentUser u = getUser ( ) ; if ( u instanceof com.google.gerrit.server.IdentifiedUser ) { return noteUtil.newIdent ( u.asIdentifiedUser ( ) . getAccount ( ) , when , serverIdent , anonymousCowardName ) ; } else if ( u instanceof com.google.gerrit.server.InternalUser ) { return serverIdent ; } throw new java.lang.IllegalStateException ( ) ; }

Target:
public Account.Id getAccountId ( ) { com.google.common.base.Preconditions.checkState ( ( ( accountId ) != null ) , "author identity for %s is not from an IdentifiedUser: %s" , getClass ( ) . getSimpleName ( ) , authorIdent.toExternalString ( ) ) ; return accountId ; }
Source:
private static long initialDelay ( java.lang.String startTime , java.lang.String interval ) { return com.google.gerrit.server.config.ScheduleConfig.builder ( com.google.gerrit.server.config.ScheduleConfigTest.config ( startTime , interval ) , "section" , "subsection" ) . setNow ( com.google.gerrit.server.config.ScheduleConfigTest.NOW ) . build ( ) . getInitialDelay ( ) ; }

Target:
private static long initialDelay ( java.lang.String startTime , java.lang.String interval ) { return com.google.gerrit.server.config.ScheduleConfig.builder ( com.google.gerrit.server.config.ScheduleConfigTest.config ( startTime , interval ) , "section" ) . setSubsection ( "subsection" ) . setNow ( com.google.gerrit.server.config.ScheduleConfigTest.NOW ) . build ( ) . schedule ( ) . initialDelay ( ) ; }
Source:
public boolean isValid ( com.google.gerrit.reviewdb.client.Patch patch ) { return ! ( ( ( listenablePrefs.get ( ) . isSkipDeleted ( ) ) && ( patch.getChangeType ( ) . equals ( ChangeType.DELETED ) ) ) || ( ( listenablePrefs.get ( ) . isSkipUncommented ( ) ) && ( ( patch.getCommentCount ( ) ) == 0 ) ) ) ; }

Target:
public boolean isValid ( com.google.gerrit.reviewdb.client.Patch patch ) { return ! ( ( ( listenablePrefs.get ( ) . skipDeleted ) && ( patch.getChangeType ( ) . equals ( ChangeType.DELETED ) ) ) || ( ( listenablePrefs.get ( ) . skipUncommented ) && ( ( patch.getCommentCount ( ) ) == 0 ) ) ) ; }
Source:
public com.google.gerrit.acceptance.RestResponse put ( java.lang.String endPoint , java.lang.Object content ) throws java.io.IOException { org.apache.http.client.methods.HttpPut put = new org.apache.http.client.methods.HttpPut ( ( ( ( url ) + "/a" ) + endPoint ) ) ; if ( content != null ) { put.addHeader ( new org.apache.http.message.BasicHeader ( "Content-Type" , "application/json" ) ) ; put.setEntity ( new org.apache.http.entity.StringEntity ( new com.google.gson.Gson ( ) . toJson ( content ) , com.google.common.base.Charsets.UTF_8.name ( ) ) ) ; } return new com.google.gerrit.acceptance.RestResponse ( getClient ( ) . execute ( put ) ) ; }

Target:
public com.google.gerrit.acceptance.RestResponse put ( java.lang.String endPoint , java.lang.Object content ) throws java.io.IOException { org.apache.http.client.methods.HttpPut put = new org.apache.http.client.methods.HttpPut ( ( ( ( url ) + "/a" ) + endPoint ) ) ; if ( content != null ) { put.addHeader ( new org.apache.http.message.BasicHeader ( "Content-Type" , "application/json" ) ) ; put.setEntity ( new org.apache.http.entity.StringEntity ( OutputFormat.JSON_COMPACT.newGson ( ) . toJson ( content ) , com.google.common.base.Charsets.UTF_8.name ( ) ) ) ; } return new com.google.gerrit.acceptance.RestResponse ( getClient ( ) . execute ( put ) ) ; }
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.index.query.QueryParseException { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > s = rewriteImpl ( in , opts ) ; if ( ! ( s instanceof com.google.gerrit.server.query.change.ChangeDataSource ) ) { in = com.google.gerrit.server.query.Predicate.and ( com.google.gerrit.server.query.change.ChangeStatusPredicate.open ( ) , in ) ; s = rewriteImpl ( in , opts ) ; } if ( ! ( s instanceof com.google.gerrit.server.query.change.ChangeDataSource ) ) { throw new com.google.gerrit.index.query.QueryParseException ( ( "invalid query: " + s ) ) ; } return s ; }

Target:
public com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > rewrite ( com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in , com.google.gerrit.index.QueryOptions opts ) throws com.google.gerrit.index.query.QueryParseException { com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > s = rewriteImpl ( in , opts ) ; if ( ! ( s instanceof com.google.gerrit.server.query.change.ChangeDataSource ) ) { in = com.google.gerrit.index.query.Predicate.and ( com.google.gerrit.server.query.change.ChangeStatusPredicate.open ( ) , in ) ; s = rewriteImpl ( in , opts ) ; } if ( ! ( s instanceof com.google.gerrit.server.query.change.ChangeDataSource ) ) { throw new com.google.gerrit.index.query.QueryParseException ( ( "invalid query: " + s ) ) ; } return s ; }
Source:
public void onSuccess ( final com.google.gwtjsonrpc.common.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.reviewdb.client.AccountGroupInclude k = getRowItem ( row ) ; if ( ( k != null ) && ( keys.contains ( k.getKey ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }

Target:
public void onSuccess ( final com.google.gwtjsonrpc.common.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.reviewdb.client.AccountGroupIncludeByUuid k = getRowItem ( row ) ; if ( ( k != null ) && ( keys.contains ( k.getKey ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }
Source:
public org.eclipse.jgit.lib.Repository createRepository ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws com.google.gerrit.server.git.RepositoryCaseMismatchException , org.eclipse.jgit.errors.RepositoryNotFoundException { org.eclipse.jgit.lib.Repository repo = createRepository ( basePath , name ) ; if ( ( ( noteDbPath ) != null ) && ( ! ( noteDbPath.equals ( basePath ) ) ) ) { createRepository ( noteDbPath , name ) ; } return repo ; }

Target:
public org.eclipse.jgit.lib.Repository createRepository ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws com.google.gerrit.server.git.RepositoryCaseMismatchException , org.eclipse.jgit.errors.RepositoryNotFoundException { org.eclipse.jgit.lib.Repository repo = createRepository ( basePath , name ) ; if ( ( notesMigration.writeChanges ( ) ) && ( ! ( noteDbPath.equals ( basePath ) ) ) ) { createRepository ( noteDbPath , name ) ; } return repo ; }
Source:
protected void configure ( ) { bind ( java.util.concurrent.Executor.class ) . annotatedWith ( com.googlesource.gerrit.plugins.webhooks.WebHooksExecutor.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.ExecutorProvider.class ) ; bind ( com.googlesource.gerrit.plugins.webhooks.Configuration.class ) . in ( Scopes.SINGLETON ) ; bind ( org.apache.http.impl.client.CloseableHttpClient.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.HttpClientProvider.class ) . in ( Scopes.SINGLETON ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.EventListener.class ) . to ( com.googlesource.gerrit.plugins.webhooks.EventHandler.class ) ; }

Target:
protected void configure ( ) { bind ( java.util.concurrent.Executor.class ) . annotatedWith ( com.googlesource.gerrit.plugins.webhooks.WebHooksExecutor.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.ExecutorProvider.class ) ; bind ( com.googlesource.gerrit.plugins.webhooks.Configuration.class ) . in ( Scopes.SINGLETON ) ; bind ( org.apache.http.impl.client.CloseableHttpClient.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.HttpClientProvider.class ) . in ( Scopes.SINGLETON ) ; factory ( PostEventTask.Factory.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.EventListener.class ) . to ( com.googlesource.gerrit.plugins.webhooks.EventHandler.class ) ; }
Source:
private boolean canCreateChanges ( ) { for ( com.google.gerrit.server.project.SectionMatcher matcher : access ( ) ) { com.google.gerrit.common.data.AccessSection section = matcher.section ; if ( section.getName ( ) . startsWith ( "refs/for/" ) ) { com.google.gerrit.common.data.Permission permission = section.getPermission ( Permission.PUSH ) ; if ( ( permission != null ) && ( controlForRef ( section.getName ( ) ) . canPerform ( Permission.PUSH ) ) ) { return true ; } } } return false ; }

Target:
private boolean canCreateChanges ( ) { for ( com.google.gerrit.server.project.SectionMatcher matcher : access ( ) ) { com.google.gerrit.common.data.AccessSection section = matcher.getSection ( ) ; if ( section.getName ( ) . startsWith ( "refs/for/" ) ) { com.google.gerrit.common.data.Permission permission = section.getPermission ( Permission.PUSH ) ; if ( ( permission != null ) && ( controlForRef ( section.getName ( ) ) . canPerform ( Permission.PUSH ) ) ) { return true ; } } } return false ; }
Source:
public void onHistoryChanged ( final java.lang.String token ) { com.google.gerrit.client.ui.Screen s ; try { s = select ( token ) ; } catch ( java.lang.RuntimeException err ) { com.google.gwt.core.client.GWT.log ( ( "Error parsing history token: " + token ) , err ) ; s = null ; } if ( s != null ) { com.google.gerrit.client.Gerrit.display ( s ) ; } else { com.google.gerrit.client.Gerrit.display ( new com.google.gerrit.client.NotFoundScreen ( ) ) ; } }

Target:
public void onValueChange ( final com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > event ) { final java.lang.String token = event.getValue ( ) ; com.google.gerrit.client.ui.Screen s ; try { s = select ( token ) ; } catch ( java.lang.RuntimeException err ) { com.google.gwt.core.client.GWT.log ( ( "Error parsing history token: " + token ) , err ) ; s = null ; } if ( s != null ) { com.google.gerrit.client.Gerrit.display ( s ) ; } else { com.google.gerrit.client.Gerrit.display ( new com.google.gerrit.client.NotFoundScreen ( ) ) ; } }
Source:
protected void onUnload ( ) { super . onUnload ( ) ; removeKeyHandlerRegs ( ) ; if ( ( resizeHandler ) != null ) { resizeHandler.removeHandler ( ) ; resizeHandler = null ; } if ( ( cmA ) != null ) { cmA.getWrapperElement ( ) . removeFromParent ( ) ; cmA = null ; } if ( ( cmB ) != null ) { cmB.getWrapperElement ( ) . removeFromParent ( ) ; cmB = null ; } com.google.gwt.user.client.Window.enableScrolling ( true ) ; com.google.gerrit.client.Gerrit.setHeaderVisible ( true ) ; }

Target:
net.codemirror.lib.CodeMirror getCmA ( ) { return cmA ; }
Source:
void initMeter ( ) { if ( ( meter ) == null ) { resetHtml ( "<tr><td></td></tr>" ) ; meter = new com.google.gerrit.client.ui.ProgressMeter ( Util.M.loadingPatchSet ( psid.get ( ) ) ) ; table.setWidget ( 0 , 0 , meter ) ; } updateMeter ( ) ; }

Target:
void initMeter ( ) { if ( ( meter ) == null ) { resetHtml ( "<tr><td></td></tr>" ) ; meter = new com.google.gwtexpui.progress.client.ProgressBar ( Util.M.loadingPatchSet ( psid.get ( ) ) ) ; table.setWidget ( 0 , 0 , meter ) ; } updateMeter ( ) ; }
Source:
public byte [ ] build ( com.google.gerrit.server.notedb.ChangeNoteUtil noteUtil ) throws java.io.IOException { java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream ( ) ; if ( noteUtil.getWriteJson ( ) ) { buildNoteJson ( noteUtil , out ) ; } else { buildNoteLegacy ( noteUtil , out ) ; } return out.toByteArray ( ) ; }

Target:
public byte [ ] build ( com.google.gerrit.server.notedb.ChangeNoteUtil noteUtil , boolean writeJson ) throws java.io.IOException { java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream ( ) ; if ( writeJson ) { buildNoteJson ( noteUtil , out ) ; } else { buildNoteLegacy ( noteUtil , out ) ; } return out.toByteArray ( ) ; }
Source:
abstract java.lang.Runnable newDraftCallback ( final net.codemirror.lib.CodeMirror cm ) ;

Target:
java.lang.Runnable newDraftCallback ( final net.codemirror.lib.CodeMirror cm ) { if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { return signInCallback ( cm ) ; } return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( cm.extras ( ) . hasActiveLine ( ) ) { newDraft ( cm ) ; } } } ; }
Source:
void onOpenForm ( ) { com.google.gwt.user.client.ui.UIObject.setVisible ( form , true ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( error , false ) ; editAssigneeIcon.setVisible ( false ) ; suggestBox.setFocus ( true ) ; suggestBox.setText ( "" ) ; }

Target:
void onOpenForm ( ) { com.google.gwt.user.client.ui.UIObject.setVisible ( form , true ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( show , false ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( error , false ) ; editAssigneeIcon.setVisible ( false ) ; suggestBox.setFocus ( true ) ; suggestBox.setText ( com.google.gerrit.client.FormatUtil.nameEmail ( currentAssignee ) ) ; suggestBox.selectAll ( ) ; }
Source:
private net.codemirror.lib.CodeMirror.GutterClickHandler onGutterClick ( final net.codemirror.lib.CodeMirror cm ) { return new net.codemirror.lib.CodeMirror.GutterClickHandler ( ) { @ java.lang.Override public void handle ( net.codemirror.lib.CodeMirror instance , int line , java.lang.String gutter , com.google.gwt.event.dom.client.MouseDownEvent clickEvent ) { instance.setCursor ( net.codemirror.lib.LineCharacter.create ( line ) ) ; instance.setActiveLine ( instance.getLineHandle ( line ) ) ; insertNewDraft ( instance ) . run ( ) ; } } ; }

Target:
private net.codemirror.lib.CodeMirror.GutterClickHandler onGutterClick ( final net.codemirror.lib.CodeMirror cm ) { return new net.codemirror.lib.CodeMirror.GutterClickHandler ( ) { @ java.lang.Override public void handle ( net.codemirror.lib.CodeMirror instance , int line , java.lang.String gutter , com.google.gwt.dom.client.NativeEvent clickEvent ) { instance.setCursor ( net.codemirror.lib.LineCharacter.create ( line ) ) ; instance.setActiveLine ( instance.getLineHandle ( line ) ) ; insertNewDraft ( instance ) . run ( ) ; } } ; }
Source:
public void newPatchSetOnWipChangeNotifyAllInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%wip,notify=ALL" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.owner ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . to ( sc.reviewer , sc.ccer ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetOnWipChangeNotifyAllInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; pushTo ( sc , "refs/for/master%wip,notify=ALL" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.reviewer ) . cc ( sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) . noOneElse ( ) ; }
Source:
public void fire ( com.google.gerrit.reviewdb.client.Project.NameKey project , java.lang.String ref ) { com.google.gerrit.server.extensions.events.GitReferenceUpdated.Event event = new com.google.gerrit.server.extensions.events.GitReferenceUpdated.Event ( project , ref ) ; for ( com.google.gerrit.extensions.events.GitReferenceUpdatedListener l : listeners ) { l.onGitReferenceUpdated ( event ) ; } }

Target:
public void fire ( com.google.gerrit.reviewdb.client.Project.NameKey project , java.lang.String ref , org.eclipse.jgit.lib.ObjectId oldObjectId , org.eclipse.jgit.lib.ObjectId newObjectId ) { org.eclipse.jgit.lib.ObjectId o = ( oldObjectId != null ) ? oldObjectId : org.eclipse.jgit.lib.ObjectId.zeroId ( ) ; org.eclipse.jgit.lib.ObjectId n = ( newObjectId != null ) ? newObjectId : org.eclipse.jgit.lib.ObjectId.zeroId ( ) ; com.google.gerrit.server.extensions.events.GitReferenceUpdated.Event event = new com.google.gerrit.server.extensions.events.GitReferenceUpdated.Event ( project , ref , o.name ( ) , n.name ( ) ) ; for ( com.google.gerrit.extensions.events.GitReferenceUpdatedListener l : listeners ) { l.onGitReferenceUpdated ( event ) ; } }
Source:
public boolean canSubmitAs ( ) { return getRefControl ( ) . canSubmitAs ( ) ; }

Target:
public boolean isPrivateVisible ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { return ( ( ( isOwner ( ) ) || ( isReviewer ( db , cd ) ) ) || ( getRefControl ( ) . canViewPrivateChanges ( ) ) ) || ( getUser ( ) . isInternalUser ( ) ) ; }
Source:
private java.io.File getPath ( ) { java.io.File basePath = site.resolve ( flags.cfg.getString ( "gerrit" , null , "basePath" ) ) ; if ( basePath == null ) { throw new java.lang.IllegalStateException ( "gerrit.basePath must be configured" ) ; } return org.eclipse.jgit.lib.RepositoryCache.FileKey.resolve ( new java.io.File ( basePath , project ) , FS.DETECTED ) ; }

Target:
private java.io.File getPath ( ) { java.nio.file.Path basePath = site.resolve ( flags.cfg.getString ( "gerrit" , null , "basePath" ) ) ; if ( basePath == null ) { throw new java.lang.IllegalStateException ( "gerrit.basePath must be configured" ) ; } return org.eclipse.jgit.lib.RepositoryCache.FileKey.resolve ( basePath.resolve ( project ) . toFile ( ) , FS.DETECTED ) ; }
Source:
boolean match ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) { if ( AccountGroup.PROJECT_OWNERS.equals ( uuid ) ) { return isDeclaredOwner ( ) ; } else { return user.getEffectiveGroups ( ) . contains ( uuid ) ; } }

Target:
boolean match ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid , boolean isChangeOwner ) { if ( AccountGroup.PROJECT_OWNERS.equals ( uuid ) ) { return isDeclaredOwner ( ) ; } else if ( AccountGroup.CHANGE_OWNER.equals ( uuid ) ) { return isChangeOwner ; } else { return user.getEffectiveGroups ( ) . contains ( uuid ) ; } }
Source:
public java.util.Collection < com.google.gerrit.reviewdb.client.PatchSetApproval > approvalsFor ( com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > db , com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > r = new java.util.ArrayList < com.google.gerrit.reviewdb.client.PatchSetApproval > ( ) ; for ( com.google.gerrit.reviewdb.client.PatchSetApproval p : approvals ( db ) ) { if ( p.getPatchSetId ( ) . equals ( psId ) ) { r.add ( p ) ; } } return r ; }

Target:
public com.google.gerrit.reviewdb.client.PatchSet currentPatchSet ( com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > db ) throws com.google.gwtorm.server.OrmException { if ( ( currentPatchSet ) == null ) { com.google.gerrit.reviewdb.client.Change c = change ( db ) ; if ( c == null ) { return null ; } for ( com.google.gerrit.reviewdb.client.PatchSet p : patches ( db ) ) { if ( p.getId ( ) . equals ( c.currentPatchSetId ( ) ) ) { currentPatchSet = p ; return p ; } } } return currentPatchSet ; }
Source:
public com.google.gerrit.server.project.ChangeControl changeControl ( ) { return changeControl ; }

Target:
public com.google.gerrit.server.project.ChangeControl changeControl ( ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { if ( ( changeControl ) == null ) { com.google.gerrit.reviewdb.client.Change c = change ( ) ; changeControl = changeControlFactory.controlFor ( c , userFactory.create ( c.getOwner ( ) ) ) ; } return changeControl ; }
Source:
public void run ( ) { java.io.File pluginFile = new java.io.File ( pluginDir , ( ( pluginName ) + ".ssh" ) ) ; try { java.nio.file.Files.copy ( pluginFile.toPath ( ) , out ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( ( "Cannot read plugin content of " + pluginFile ) , e ) ; } }

Target:
public void run ( ) { java.nio.file.Path pluginPath = pluginDir.resolve ( ( ( pluginName ) + ".ssh" ) ) ; try { java.nio.file.Files.copy ( pluginPath , out ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( ( "Cannot read plugin content of " + pluginPath ) , e ) ; } }
Source:
public void onBlur ( com.google.gwt.event.dom.client.BlurEvent event ) { groups.setRegisterKeys ( true ) ; }

Target:
protected void onInitUI ( ) { super . onInitUI ( ) ; setPageTitle ( Util.C.groupListTitle ( ) ) ; createGroupLinkPanel = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; createGroupLinkPanel.setStyleName ( Gerrit.RESOURCES.css ( ) . createGroupLink ( ) ) ; createGroupLinkPanel.add ( new com.google.gerrit.client.ui.Hyperlink ( Util.C.headingCreateGroup ( ) , com.google.gerrit.common.PageLinks.ADMIN_CREATE_GROUP ) ) ; add ( createGroupLinkPanel ) ; groups = new com.google.gerrit.client.admin.GroupTable ( true , com.google.gerrit.common.PageLinks.ADMIN_GROUPS ) ; add ( groups ) ; }
Source:
public java.nio.file.FileVisitResult preVisitDirectory ( java.nio.file.Path dir , java.nio.file.attribute.BasicFileAttributes attrs ) throws java.io.IOException { java.lang.String fName = dir.getFileName ( ) . toString ( ) ; if ( ( fName.endsWith ( ".deleted" ) ) && ( fName.matches ( ".*\\d{13}.deleted$" ) ) ) { com.googlesource.gerrit.plugins.deleteproject.fs.DeleteTrashFolders.log.warn ( "Will delete this folder: {}" , dir ) ; recursiveDelete ( dir ) ; return java.nio.file.FileVisitResult.SKIP_SUBTREE ; } return super . preVisitDirectory ( dir , attrs ) ; }

Target:
public java.nio.file.FileVisitResult preVisitDirectory ( java.nio.file.Path dir , java.nio.file.attribute.BasicFileAttributes attrs ) throws java.io.IOException { java.lang.String fName = dir.getFileName ( ) . toString ( ) ; if ( ( fName.endsWith ( ".deleted" ) ) && ( fName.matches ( ".*\\d{13}.deleted$" ) ) ) { com.googlesource.gerrit.plugins.deleteproject.fs.DeleteTrashFolders.log.warn ( "Will delete this folder: {}" , dir ) ; recursiveDelete ( dir ) ; return java.nio.file.FileVisitResult.SKIP_SUBTREE ; } else if ( org.eclipse.jgit.lib.RepositoryCache.FileKey.isGitRepository ( dir.toFile ( ) , FS.DETECTED ) ) { return java.nio.file.FileVisitResult.SKIP_SUBTREE ; } return super . preVisitDirectory ( dir , attrs ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { branch = new com.google.gerrit.reviewdb.client.Branch.NameKey ( project , "test" ) ; adminSession.put ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches/" ) + ( branch.getShortName ( ) ) ) ) . consume ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { branch = new com.google.gerrit.reviewdb.client.Branch.NameKey ( project , "test" ) ; branch ( ) . create ( new com.google.gerrit.extensions.api.projects.BranchInput ( ) ) ; }
Source:
protected org.apache.sshd.common.session.AbstractSession createSession ( final org.apache.mina.core.session.IoSession io ) throws java.lang.Exception { if ( ( io.getConfig ( ) ) instanceof org.apache.mina.transport.socket.SocketSessionConfig ) { final org.apache.mina.transport.socket.SocketSessionConfig c = ( ( org.apache.mina.transport.socket.SocketSessionConfig ) ( io.getConfig ( ) ) ) ; c.setKeepAlive ( keepAlive ) ; } final org.apache.sshd.common.session.AbstractSession s = super . createSession ( io ) ; s.setAttribute ( SshUtil.REMOTE_PEER , io.getRemoteAddress ( ) ) ; return s ; }

Target:
protected org.apache.sshd.common.session.AbstractSession createSession ( final org.apache.mina.core.session.IoSession io ) throws java.lang.Exception { if ( ( io.getConfig ( ) ) instanceof org.apache.mina.transport.socket.SocketSessionConfig ) { final org.apache.mina.transport.socket.SocketSessionConfig c = ( ( org.apache.mina.transport.socket.SocketSessionConfig ) ( io.getConfig ( ) ) ) ; c.setKeepAlive ( keepAlive ) ; } final org.apache.sshd.common.session.AbstractSession s = super . createSession ( io ) ; s.setAttribute ( SshUtil.REMOTE_PEER , io.getRemoteAddress ( ) ) ; s.setAttribute ( SshUtil.ACTIVE , new java.util.ArrayList < com.google.gerrit.server.ssh.AbstractCommand > ( 2 ) ) ; return s ; }
Source:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; codeReview = com.google.common.base.Preconditions.checkNotNull ( cfg.getLabelSections ( ) . get ( "Code-Review" ) ) ; codeReview.setCopyMinScore ( false ) ; codeReview.setCopyMaxScore ( false ) ; codeReview.setCopyAllScoresOnTrivialRebase ( false ) ; codeReview.setCopyAllScoresIfNoCodeChange ( false ) ; codeReview.setCopyAllScoresIfNoChange ( false ) ; codeReview.setDefaultValue ( ( ( short ) ( - 1 ) ) ) ; saveProjectConfig ( cfg ) ; }

Target:
public void noCopyAllScoresIfNoChange ( ) throws java.lang.Exception { codeReview.setCopyAllScoresIfNoChange ( false ) ; saveLabelConfig ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result patchSet = readyPatchSetForNoChangeRebase ( ) ; rebase ( patchSet ) ; assertApproval ( patchSet , 0 ) ; }
Source:
private void loadPatchSets ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { detail.setPatchSets ( db.patchSets ( ) . byChange ( changeId ) . toList ( ) ) ; }

Target:
private void loadMessages ( ) throws com.google.gwtorm.client.OrmException { detail.setMessages ( db.changeMessages ( ) . byChange ( changeId ) . toList ( ) ) ; for ( final com.google.gerrit.client.reviewdb.ChangeMessage m : detail.getMessages ( ) ) { acc.want ( m.getAuthor ( ) ) ; } }
Source:
public java.util.SortedSet < com.google.gerrit.reviewdb.client.Project.NameKey > list ( ) { namesUpdateLock.lock ( ) ; try { java.util.SortedSet < com.google.gerrit.reviewdb.client.Project.NameKey > n = new java.util.TreeSet < > ( ) ; scanProjects ( basePath , "" , n ) ; names = java.util.Collections.unmodifiableSortedSet ( n ) ; return n ; } finally { namesUpdateLock.unlock ( ) ; } }

Target:
public java.util.SortedSet < com.google.gerrit.reviewdb.client.Project.NameKey > list ( ) { namesUpdateLock.lock ( ) ; try { com.google.gerrit.server.git.LocalDiskRepositoryManager.ProjectVisitor visitor = new com.google.gerrit.server.git.LocalDiskRepositoryManager.ProjectVisitor ( ) ; try { java.nio.file.Files.walkFileTree ( basePath , java.util.EnumSet.of ( java.nio.file.FileVisitOption.FOLLOW_LINKS ) , java.lang.Integer.MAX_VALUE , visitor ) ; } catch ( java.io.IOException e ) { com.google.gerrit.server.git.LocalDiskRepositoryManager.log.error ( ( "Error walking repository tree " + ( basePath.toAbsolutePath ( ) ) ) , e ) ; } return java.util.Collections.unmodifiableSortedSet ( visitor.found ) ; } finally { namesUpdateLock.unlock ( ) ; } }
Source:
int getParentNumFromDisplaySide ( com.google.gerrit.client.diff.DisplaySide side ) { if ( ( ( side == ( DisplaySide.A ) ) && ( ( base ) != null ) ) && ( ( base.get ( ) ) < 0 ) ) { return - ( base.get ( ) ) ; } return 0 ; }

Target:
int getParentNumFromDisplaySide ( com.google.gerrit.client.diff.DisplaySide side ) { if ( side == ( DisplaySide.A ) ) { return base.getParentNum ( ) ; } return 0 ; }
Source:
public void basicGroupProperties ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.GroupInfo createdGroup = gApi.groups ( ) . create ( name ( "group" ) ) . get ( ) ; com.google.gerrit.server.group.db.GroupBundle reviewDbBundle = bundleFactory.fromReviewDb ( db , new com.google.gerrit.reviewdb.client.AccountGroup.Id ( createdGroup.groupId ) ) ; deleteGroupRefs ( reviewDbBundle ) ; assertMigratedCleanly ( rebuild ( reviewDbBundle ) , reviewDbBundle ) ; }

Target:
public void basicGroupProperties ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.GroupInfo createdGroup = gApi.groups ( ) . create ( name ( "group" ) ) . get ( ) ; com.google.gerrit.server.group.db.GroupBundle reviewDbBundle = GroupBundle.Factory.fromReviewDb ( db , new com.google.gerrit.reviewdb.client.AccountGroup.Id ( createdGroup.groupId ) ) ; deleteGroupRefs ( reviewDbBundle ) ; assertMigratedCleanly ( rebuild ( reviewDbBundle ) , reviewDbBundle ) ; }
Source:
private void initAgreements ( ) { grid.addHeader ( new com.google.gerrit.client.ui.SmallHeading ( Util.C.headingAgreements ( ) ) ) ; contributorAgreements = com.google.gerrit.client.admin.ProjectInfoScreen.newInheritedBooleanBox ( ) ; if ( com.google.gerrit.client.Gerrit.info ( ) . auth ( ) . useContributorAgreements ( ) ) { saveEnabler.listenTo ( contributorAgreements ) ; grid.add ( Util.C.useContributorAgreements ( ) , contributorAgreements ) ; } signedOffBy = com.google.gerrit.client.admin.ProjectInfoScreen.newInheritedBooleanBox ( ) ; saveEnabler.listenTo ( signedOffBy ) ; grid.addHtml ( Util.C.useSignedOffBy ( ) , signedOffBy ) ; }

Target:
private void initAgreements ( ) { grid.addHeader ( new com.google.gerrit.client.ui.SmallHeading ( AdminConstants.I.headingAgreements ( ) ) ) ; contributorAgreements = com.google.gerrit.client.admin.ProjectInfoScreen.newInheritedBooleanBox ( ) ; if ( com.google.gerrit.client.Gerrit.info ( ) . auth ( ) . useContributorAgreements ( ) ) { saveEnabler.listenTo ( contributorAgreements ) ; grid.add ( AdminConstants.I.useContributorAgreements ( ) , contributorAgreements ) ; } signedOffBy = com.google.gerrit.client.admin.ProjectInfoScreen.newInheritedBooleanBox ( ) ; saveEnabler.listenTo ( signedOffBy ) ; grid.addHtml ( AdminConstants.I.useSignedOffBy ( ) , signedOffBy ) ; }
Source:
public void setUp ( ) { com.google.common.truth.TruthJUnit.assume ( ) . that ( migration.readFromNoteDb ( ) ) . isFalse ( ) ; }

Target:
public void setUp ( ) { com.google.common.truth.TruthJUnit.assume ( ) . that ( migration.readFromNoteDb ( ) ) . isFalse ( ) ; com.google.gerrit.server.group.db.AuditLogFormatter auditLogFormatter = com.google.gerrit.server.group.db.AuditLogFormatter.createBackedBy ( accountCache , groupBackend , serverId ) ; rebuilder = new com.google.gerrit.server.group.db.GroupRebuilder ( serverIdent.get ( ) , allUsers , auditLogFormatter ) ; }
Source:
protected void configure ( ) { bind ( java.util.concurrent.ScheduledThreadPoolExecutor.class ) . annotatedWith ( com.googlesource.gerrit.plugins.webhooks.WebHooksExecutor.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.ExecutorProvider.class ) ; bind ( com.googlesource.gerrit.plugins.webhooks.Configuration.class ) . in ( Scopes.SINGLETON ) ; bind ( org.apache.http.impl.client.CloseableHttpClient.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.HttpClientProvider.class ) . in ( Scopes.SINGLETON ) ; factory ( PostTask.Factory.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.EventListener.class ) . to ( com.googlesource.gerrit.plugins.webhooks.EventHandler.class ) ; }

Target:
protected void configure ( ) { bind ( java.util.concurrent.ScheduledExecutorService.class ) . annotatedWith ( com.googlesource.gerrit.plugins.webhooks.WebHooksExecutor.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.ExecutorProvider.class ) ; bind ( com.googlesource.gerrit.plugins.webhooks.Configuration.class ) . in ( Scopes.SINGLETON ) ; bind ( org.apache.http.impl.client.CloseableHttpClient.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.HttpClientProvider.class ) . in ( Scopes.SINGLETON ) ; factory ( PostTask.Factory.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.EventListener.class ) . to ( com.googlesource.gerrit.plugins.webhooks.EventHandler.class ) ; }
Source:
private void assertTagList ( com.google.common.collect.FluentIterable < java.lang.String > expected , java.util.List < com.google.gerrit.extensions.api.projects.TagInfo > actual ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( actual ) . hasSize ( expected.size ( ) ) ; for ( int i = 0 ; i < ( expected.size ( ) ) ; i ++ ) { com.google.common.truth.Truth.assertThat ( actual.get ( i ) . ref ) . isEqualTo ( ( ( org.eclipse.jgit.lib.Constants.R_TAGS ) + ( expected.get ( i ) ) ) ) ; } }

Target:
private void assertTagList ( com.google.common.collect.FluentIterable < java.lang.String > expected , java.util.List < com.google.gerrit.extensions.api.projects.TagInfo > actual ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( actual ) . hasSize ( expected.size ( ) ) ; for ( int i = 0 ; i < ( expected.size ( ) ) ; i ++ ) { com.google.gerrit.extensions.api.projects.TagInfo info = actual.get ( i ) ; com.google.common.truth.Truth.assertThat ( info.created ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( info.ref ) . isEqualTo ( ( ( org.eclipse.jgit.lib.Constants.R_TAGS ) + ( expected.get ( i ) ) ) ) ; } }
Source:
private void fireEvent ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , final com.google.gerrit.server.events.ChangeEvent event ) { for ( com.google.gerrit.common.ChangeHookRunner.ChangeListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( branchName , holder.user ) ) { holder.listener.onChangeEvent ( event ) ; } } }

Target:
private void fireEvent ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , final com.google.gerrit.server.events.ChangeEvent event ) { for ( com.google.gerrit.common.ChangeHookRunner.ChangeListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( branchName , holder.user ) ) { holder.listener.onChangeEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }
Source:
public static void addIncludedGroup ( com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUUID , java.lang.String includedGroup , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.groups.GroupInfo > cb ) { java.lang.String n = com.google.gwt.http.client.URL.encodePathSegment ( includedGroup ) ; new com.google.gerrit.client.rpc.RestApi ( ( ( ( com.google.gerrit.client.groups.GroupApi.includedGroupsBase ( groupUUID ) ) + "/" ) + n ) ) . put ( cb ) ; }

Target:
public static void addIncludedGroup ( com.google.gerrit.reviewdb.client.AccountGroup.UUID group , java.lang.String include , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.groups.GroupInfo > cb ) { com.google.gerrit.client.groups.GroupApi.groups ( group ) . id ( include ) . put ( cb ) ; }
Source:
public void testOwnerProject ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.OWNER , com.google.gerrit.server.project.Util.ADMIN , "refs/*" ) ; com.google.gerrit.server.project.ProjectControl uBlah = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl uAdmin = util.user ( local , com.google.gerrit.server.project.Util.DEVS , com.google.gerrit.server.project.Util.ADMIN ) ; org.junit.Assert.assertFalse ( "not owner" , uBlah.isOwner ( ) ) ; org.junit.Assert.assertTrue ( "is owner" , uAdmin.isOwner ( ) ) ; }

Target:
public void testOwnerProject ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.OWNER , com.google.gerrit.server.project.Util.ADMIN , "refs/*" ) ; com.google.gerrit.server.project.ProjectControl uBlah = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl uAdmin = util.user ( local , com.google.gerrit.server.project.Util.DEVS , com.google.gerrit.server.project.Util.ADMIN ) ; org.junit.Assert.assertFalse ( "not owner" , uBlah.isOwner ( ) ) ; org.junit.Assert.assertTrue ( "is owner" , uAdmin.isOwner ( ) ) ; }
Source:
public void atomicDelete ( com.google.gerrit.reviewdb.client.Project project ) throws com.google.gwtorm.server.OrmException { com.google.gwtorm.server.ResultSet < com.google.gerrit.reviewdb.client.Change > changes = null ; changes = db.changes ( ) . byProject ( project.getNameKey ( ) ) ; deleteChanges ( changes ) ; db.accountProjectWatches ( ) . delete ( db.accountProjectWatches ( ) . byProject ( project.getNameKey ( ) ) ) ; }

Target:
public void atomicDelete ( com.google.gerrit.reviewdb.client.Project project ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.server.query.change.ChangeData > changes = queryProvider.get ( ) . byProject ( project.getNameKey ( ) ) ; deleteChanges ( changes ) ; db.accountProjectWatches ( ) . delete ( db.accountProjectWatches ( ) . byProject ( project.getNameKey ( ) ) ) ; }
Source:
void onReply ( com.google.gwt.event.dom.client.ClickEvent e ) { if ( ( replyBox ) == null ) { com.google.gerrit.client.diff.DraftBox box = getDiffView ( ) . addReply ( getOriginal ( ) , "" , false ) ; registerReplyBox ( box ) ; } else { openReplyBox ( ) ; } }

Target:
void onReply ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( parent.getToken ( ) ) ; } else if ( ( replyBox ) == null ) { registerReplyBox ( parent.addDraftBox ( parent.createReply ( comment ) ) ) ; } else { openReplyBox ( ) ; } }
Source:
private com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.AccessToken newAccessTokenFromUser ( java.lang.String username ) { com.google.gerrit.server.account.AccountState account = accountCache.getByUsername ( username ) ; java.util.Collection < com.google.gerrit.reviewdb.client.AccountExternalId > externalIds = account.getExternalIds ( ) ; for ( com.google.gerrit.reviewdb.client.AccountExternalId accountExternalId : externalIds ) { java.lang.String key = accountExternalId.getKey ( ) . get ( ) ; if ( key.startsWith ( com.googlesource.gerrit.plugins.github.oauth.IdentifiedUserGitHubLoginProvider.EXTERNAL_ID_PREFIX ) ) { return new com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.AccessToken ( key.substring ( com.googlesource.gerrit.plugins.github.oauth.IdentifiedUserGitHubLoginProvider.EXTERNAL_ID_PREFIX.length ( ) ) ) ; } } return null ; }

Target:
private com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.AccessToken newAccessTokenFromUser ( java.lang.String username ) { com.google.gerrit.server.account.AccountState account = accountCache.getByUsername ( username ) ; java.util.Collection < com.google.gerrit.server.account.ExternalId > externalIds = account.getExternalIds ( ) ; for ( com.google.gerrit.server.account.ExternalId accountExternalId : externalIds ) { java.lang.String key = accountExternalId.asAccountExternalId ( ) . getKey ( ) . get ( ) ; if ( key.startsWith ( com.googlesource.gerrit.plugins.github.oauth.IdentifiedUserGitHubLoginProvider.EXTERNAL_ID_PREFIX ) ) { return new com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.AccessToken ( key.substring ( com.googlesource.gerrit.plugins.github.oauth.IdentifiedUserGitHubLoginProvider.EXTERNAL_ID_PREFIX.length ( ) ) ) ; } } return null ; }
Source:
public com.google.gerrit.reviewdb.client.Change submit ( com.google.gerrit.server.change.RevisionResource rsrc , com.google.gerrit.server.IdentifiedUser caller , boolean force ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( submitWholeTopic ) { return submitWholeTopic ( rsrc , caller , force ) ; } else { return submitThisChange ( rsrc , caller , force ) ; } }

Target:
public com.google.gerrit.reviewdb.client.Change submit ( com.google.gerrit.server.change.RevisionResource rsrc , com.google.gerrit.server.IdentifiedUser caller , boolean force ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException , java.io.IOException { java.lang.String topic = rsrc.getChange ( ) . getTopic ( ) ; if ( ( submitWholeTopic ) && ( ! ( com.google.common.base.Strings.isNullOrEmpty ( topic ) ) ) ) { return submitWholeTopic ( rsrc , caller , force , topic ) ; } else { return submitThisChange ( rsrc , caller , force ) ; } }
Source:
public void setAssigneeOnWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; assign ( sc , sc.owner , assignee ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) . to ( 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 ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) . to ( sc.assignee ) ; }
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 AccountResource.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 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 ( ) ) ) ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { if ( Hyperlink.impl.handleAsClick ( ( ( com.google.gwt.user.client.Event ) ( event.getNativeEvent ( ) ) ) ) ) { event.stopPropagation ( ) ; event.preventDefault ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toProject ( info.project_name_key ( ) ) ) ; } }