auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void patchScript ( final com.google.gerrit.reviewdb.client.Patch.Key patchKey , final com.google.gerrit.reviewdb.client.PatchSet.Id psa , final com.google.gerrit.reviewdb.client.PatchSet.Id psb , final com.google.gerrit.reviewdb.client.AccountDiffPreference dp , final com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.common.data.PatchScript > callback ) { if ( psb == null ) { callback.onFailure ( new com.google.gerrit.common.errors.NoSuchEntityException ( ) ) ; return ; } com.google.gerrit.httpd.rpc.Handler.wrap ( patchScriptFactoryFactory.create ( patchKey , psa , psb , dp ) ) . to ( callback ) ; }

Target:
public void patchScript ( final com.google.gerrit.reviewdb.client.Patch.Key patchKey , final com.google.gerrit.reviewdb.client.PatchSet.Id psa , final com.google.gerrit.reviewdb.client.PatchSet.Id psb , final com.google.gerrit.reviewdb.client.AccountDiffPreference dp , final com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.common.data.PatchScript > callback ) { if ( psb == null ) { callback.onFailure ( new com.google.gerrit.common.errors.NoSuchEntityException ( ) ) ; return ; } patchScriptFactoryFactory.create ( patchKey , psa , psb , dp ) . to ( callback ) ; }
Source:
public com.google.gerrit.server.project.RefControl forUser ( com.google.gerrit.server.CurrentUser who ) { com.google.gerrit.server.project.ProjectControl newCtl = projectControl.forUser ( who ) ; if ( relevant.isUserSpecific ( ) ) { return newCtl.controlForRef ( getRefName ( ) ) ; } else { return new com.google.gerrit.server.project.RefControl ( newCtl , getRefName ( ) , relevant ) ; } }

Target:
public com.google.gerrit.server.project.RefControl forUser ( com.google.gerrit.server.CurrentUser who ) { com.google.gerrit.server.project.ProjectControl newCtl = projectControl.forUser ( who ) ; if ( relevant.isUserSpecific ( ) ) { return newCtl.controlForRef ( getRefName ( ) ) ; } return new com.google.gerrit.server.project.RefControl ( newCtl , getRefName ( ) , relevant ) ; }
Source:
private void group ( java.lang.String name , java.lang.String ownerGroup ) throws java.io.IOException { com.google.gerrit.server.group.CreateGroup.Input in = new com.google.gerrit.server.group.CreateGroup.Input ( ) ; in.ownerId = ownerGroup ; adminSession.put ( ( "/groups/" + name ) , in ) . consume ( ) ; }

Target:
private java.lang.String group ( java.lang.String name , java.lang.String ownerGroup ) throws java.io.IOException { name = name ( name ) ; com.google.gerrit.server.group.CreateGroup.Input in = new com.google.gerrit.server.group.CreateGroup.Input ( ) ; in.ownerId = ownerGroup ; adminSession.put ( ( "/groups/" + name ) , in ) . consume ( ) ; return name ; }
Source:
private void clearActiveLine ( net.codemirror.lib.CodeMirror cm ) { if ( cm.hasActiveLine ( ) ) { net.codemirror.lib.CodeMirror.LineHandle activeLine = cm.getActiveLine ( ) ; cm.removeLineClass ( activeLine , LineClassWhere.WRAP , DiffTable.style.activeLine ( ) ) ; cm.removeLineClass ( activeLine , LineClassWhere.BACKGROUND , DiffTable.style.activeLineBg ( ) ) ; cm.setActiveLine ( null ) ; } }

Target:
private void clearActiveLine ( net.codemirror.lib.CodeMirror cm ) { if ( cm.hasActiveLine ( ) ) { net.codemirror.lib.CodeMirror.LineHandle activeLine = cm.getActiveLine ( ) ; cm.removeLineClass ( activeLine , LineClassWhere.WRAP , DiffTable.style.activeLine ( ) ) ; cm.setActiveLine ( null ) ; } }
Source:
public static java.lang.String getToken ( final javax.servlet.http.HttpServletRequest req ) { java.lang.String encodedToken = req.getPathInfo ( ) ; if ( com.google.common.base.Strings.isNullOrEmpty ( encodedToken ) ) { return com.google.gerrit.httpd.LoginUrlToken.DEFAULT_TOKEN ; } else { return com.google.common.base.CharMatcher.is ( '/' ) . trimLeadingFrom ( com.google.gerrit.extensions.restapi.Url.decode ( encodedToken ) ) ; } }

Target:
public static java.lang.String getToken ( final javax.servlet.http.HttpServletRequest req ) { java.lang.String token = req.getPathInfo ( ) ; if ( com.google.common.base.Strings.isNullOrEmpty ( token ) ) { return com.google.gerrit.httpd.LoginUrlToken.DEFAULT_TOKEN ; } else { return com.google.common.base.CharMatcher.is ( '/' ) . trimLeadingFrom ( token ) ; } }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.RequestCleanup.class ) . in ( com.google.inject.servlet.RequestScoped.class ) ; bind ( com.google.gerrit.server.config.RequestScopedReviewDbProvider.class ) ; bind ( IdentifiedUser.RequestFactory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( com.google.gerrit.server.project.PerRequestProjectControlCache.class ) . in ( com.google.inject.servlet.RequestScoped.class ) ; bind ( ChangeControl.Factory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( ProjectControl.Factory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; factory ( SubmoduleOp.Factory.class ) ; factory ( MergeOp.Factory.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.RequestCleanup.class ) . in ( com.google.inject.servlet.RequestScoped.class ) ; bind ( com.google.gerrit.server.config.RequestScopedReviewDbProvider.class ) ; bind ( IdentifiedUser.RequestFactory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( com.google.gerrit.server.project.PerRequestProjectControlCache.class ) . in ( com.google.inject.servlet.RequestScoped.class ) ; bind ( ProjectControl.Factory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; factory ( SubmoduleOp.Factory.class ) ; factory ( MergeOp.Factory.class ) ; }
Source:
private com.google.gerrit.common.data.SubmitTypeRecord typeError ( java.lang.String err , java.lang.Exception e ) { if ( logErrors ) { if ( e == null ) { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err ) ; } else { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err , e ) ; } return com.google.gerrit.server.project.SubmitRuleEvaluator.defaultTypeError ( ) ; } else { return com.google.gerrit.common.data.SubmitTypeRecord.error ( err ) ; } }

Target:
private com.google.gerrit.common.data.SubmitTypeRecord typeError ( java.lang.String err , java.lang.Exception e ) { if ( logErrors ) { if ( e == null ) { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err ) ; } else { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err , e ) ; } return com.google.gerrit.server.project.SubmitRuleEvaluator.defaultTypeError ( ) ; } return com.google.gerrit.common.data.SubmitTypeRecord.error ( err ) ; }
Source:
public java.util.List < com.google.gerrit.server.query.change.ChangeData > byProjectCommits ( com.google.gerrit.reviewdb.client.Project.NameKey project , java.util.List < java.lang.String > hashes ) throws com.google.gwtorm.server.OrmException { int n = ( indexConfig.maxTerms ( ) ) - 1 ; com.google.common.base.Preconditions.checkArgument ( ( ( hashes.size ( ) ) <= n ) , "cannot exceed %s commits" , n ) ; return query ( com.google.gerrit.server.query.Predicate.and ( com.google.gerrit.server.query.change.InternalChangeQuery.project ( project ) , com.google.gerrit.server.query.Predicate.or ( com.google.gerrit.server.query.change.InternalChangeQuery.commits ( com.google.gerrit.server.query.change.InternalChangeQuery.schema ( indexes ) , hashes ) ) ) ) ; }

Target:
public java.util.List < com.google.gerrit.server.query.change.ChangeData > byProjectCommits ( com.google.gerrit.reviewdb.client.Project.NameKey project , java.util.List < java.lang.String > hashes ) throws com.google.gwtorm.server.OrmException { int n = ( indexConfig.maxTerms ( ) ) - 1 ; com.google.common.base.Preconditions.checkArgument ( ( ( hashes.size ( ) ) <= n ) , "cannot exceed %s commits" , n ) ; return query ( com.google.gerrit.server.query.Predicate.and ( com.google.gerrit.server.query.change.InternalChangeQuery.project ( project ) , com.google.gerrit.server.query.Predicate.or ( com.google.gerrit.server.query.change.InternalChangeQuery.commits ( hashes ) ) ) ) ; }
Source:
public void postUpdate ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) throws com.google.gwtorm.server.OrmException { if ( ( updated ( ) ) && ( fireEvent ) ) { hashtagsEdited.fire ( change , ctx.getUser ( ) . getAccountId ( ) , updatedHashtags , toAdd , toRemove , ctx.getWhen ( ) ) ; } }

Target:
public void postUpdate ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) throws com.google.gwtorm.server.OrmException { if ( ( updated ( ) ) && ( fireEvent ) ) { hashtagsEdited.fire ( change , ctx.getAccountId ( ) , updatedHashtags , toAdd , toRemove , ctx.getWhen ( ) ) ; } }
Source:
public void uploadPackSubsetOfBranchesVisibleNotIncludingHead ( ) throws java.lang.Exception { deny ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/master" ) ; allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/branch" ) ; setApiUser ( user ) ; assertUploadPackRefs ( ( ( r2 ) + "1" ) , ( ( r2 ) + "meta" ) , ( ( r4 ) + "1" ) , ( ( r4 ) + "meta" ) , "refs/heads/branch" , "refs/tags/branch-tag" , "refs/tags/master-tag" ) ; }

Target:
public void uploadPackSubsetOfBranchesVisibleNotIncludingHead ( ) throws java.lang.Exception { deny ( "refs/heads/master" , Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; allow ( "refs/heads/branch" , Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; setApiUser ( user ) ; assertUploadPackRefs ( ( ( r2 ) + "1" ) , ( ( r2 ) + "meta" ) , ( ( r4 ) + "1" ) , ( ( r4 ) + "meta" ) , "refs/heads/branch" , "refs/tags/branch-tag" , "refs/tags/master-tag" ) ; }
Source:
public com.google.gerrit.extensions.common.DiffInfo diff ( java.lang.String base ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return getDiff.get ( ) . setBase ( base ) . apply ( file ) . value ( ) ; } catch ( java.io.IOException | com.google.gerrit.server.project.InvalidChangeOperationException | com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve diff" , e ) ; } }

Target:
public com.google.gerrit.extensions.common.DiffInfo diff ( java.lang.String base ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return getDiff.setBase ( base ) . apply ( file ) . value ( ) ; } catch ( java.io.IOException | com.google.gerrit.server.project.InvalidChangeOperationException | com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve diff" , e ) ; } }
Source:
public void testCreateSchema_DefaultAccess_RegisteredUsers ( ) throws com.google.gwtorm.client.OrmException { db.create ( ) ; final com.google.gerrit.reviewdb.SystemConfig config = getSystemConfig ( ) ; assertDefaultRight ( config.registeredGroupId , ApprovalCategory.READ , 1 , 2 ) ; assertDefaultRight ( config.registeredGroupId , codeReview , ( - 1 ) , 1 ) ; }

Target:
public void testCreateSchema_DefaultAccess_RegisteredUsers ( ) throws com.google.gwtorm.client.OrmException { db.create ( ) ; final com.google.gerrit.reviewdb.SystemConfig config = db.getSystemConfig ( ) ; assertDefaultRight ( config.registeredGroupId , ApprovalCategory.READ , 1 , 2 ) ; assertDefaultRight ( config.registeredGroupId , codeReview , ( - 1 ) , 1 ) ; }
Source:
private static void assertCommentInfo ( com.google.gerrit.extensions.api.changes.ReviewInput.CommentInput expected , com.google.gerrit.extensions.common.CommentInfo actual ) { org.junit.Assert.assertEquals ( expected.line , actual.line ) ; org.junit.Assert.assertEquals ( expected.message , actual.message ) ; org.junit.Assert.assertEquals ( expected.inReplyTo , actual.inReplyTo ) ; if ( ( actual.side ) == null ) { org.junit.Assert.assertEquals ( expected.side , Comment.Side.REVISION ) ; } }

Target:
private static void assertCommentInfo ( com.google.gerrit.extensions.api.changes.ReviewInput.CommentInput expected , com.google.gerrit.extensions.common.CommentInfo actual ) { com.google.common.truth.Truth.assertThat ( actual.line ) . isEqualTo ( expected.line ) ; com.google.common.truth.Truth.assertThat ( actual.message ) . isEqualTo ( expected.message ) ; com.google.common.truth.Truth.assertThat ( actual.inReplyTo ) . isEqualTo ( expected.inReplyTo ) ; if ( ( actual.side ) == null ) { com.google.common.truth.Truth.assertThat ( Comment.Side.REVISION ) . isEqualTo ( expected.side ) ; } }
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 | com.google.gerrit.common.errors.EmailException | 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.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:
private java.util.Map < org.eclipse.jgit.lib.ObjectId , org.eclipse.jgit.lib.Ref > changeRefsById ( ) throws java.io.IOException { if ( ( refsById ) == null ) { refsById = new java.util.HashMap < org.eclipse.jgit.lib.ObjectId , org.eclipse.jgit.lib.Ref > ( ) ; for ( org.eclipse.jgit.lib.Ref r : repo.getRefDatabase ( ) . getRefs ( "refs/changes/" ) . values ( ) ) { if ( com.google.gerrit.reviewdb.PatchSet.isRef ( r.getName ( ) ) ) { refsById.put ( r.getObjectId ( ) , r ) ; } } } return refsById ; }

Target:
private java.util.Map < org.eclipse.jgit.lib.ObjectId , org.eclipse.jgit.lib.Ref > changeRefsById ( ) throws java.io.IOException { if ( ( refsById ) == null ) { refsById = new java.util.HashMap < org.eclipse.jgit.lib.ObjectId , org.eclipse.jgit.lib.Ref > ( ) ; for ( org.eclipse.jgit.lib.Ref r : repo.getRefDatabase ( ) . getRefs ( "refs/changes/" ) . values ( ) ) { if ( com.google.gerrit.reviewdb.client.PatchSet.isRef ( r.getName ( ) ) ) { refsById.put ( r.getObjectId ( ) , r ) ; } } } return refsById ; }
Source:
public void load ( org.eclipse.jgit.revwalk.RevWalk walk , org.eclipse.jgit.lib.ObjectId id ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { this . reader = walk.getObjectReader ( ) ; try { revision = ( id != null ) ? new org.eclipse.jgit.revwalk.RevWalk ( reader ) . parseCommit ( id ) : null ; onLoad ( ) ; } finally { reader = null ; } }

Target:
public void load ( org.eclipse.jgit.revwalk.RevWalk walk , org.eclipse.jgit.lib.ObjectId id ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { this . reader = walk.getObjectReader ( ) ; try { revision = ( id != null ) ? walk.parseCommit ( id ) : null ; onLoad ( ) ; } finally { reader = null ; } }
Source:
public void addHashtagWithPermissionAllowed ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; grant ( Permission.EDIT_HASHTAGS , project , "refs/heads/master" , false , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; setApiUser ( user ) ; addHashtags ( r , "MyHashtag" ) ; assertThatGet ( r ) . containsExactly ( "MyHashtag" ) ; assertMessage ( r , "Hashtag added: MyHashtag" ) ; }

Target:
public void addHashtagWithPermissionAllowed ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; grant ( project , "refs/heads/master" , Permission.EDIT_HASHTAGS , false , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; setApiUser ( user ) ; addHashtags ( r , "MyHashtag" ) ; assertThatGet ( r ) . containsExactly ( "MyHashtag" ) ; assertMessage ( r , "Hashtag added: MyHashtag" ) ; }
Source:
public void run ( ) { try { com.google.gerrit.server.mail.MergedSender cm = mergedSenderFactory.create ( ctx.getProject ( ) , psId.getParentKey ( ) ) ; cm.setFrom ( ctx.getUser ( ) . getAccountId ( ) ) ; cm.setPatchSet ( patchSet , info ) ; cm.send ( ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.git.MergedByPushOp.log.error ( ( "Cannot send email for submitted patch set " + ( psId ) ) , e ) ; } }

Target:
public void run ( ) { try { com.google.gerrit.server.mail.MergedSender cm = mergedSenderFactory.create ( ctx.getProject ( ) , psId.getParentKey ( ) ) ; cm.setFrom ( ctx.getAccountId ( ) ) ; cm.setPatchSet ( patchSet , info ) ; cm.send ( ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.git.MergedByPushOp.log.error ( ( "Cannot send email for submitted patch set " + ( psId ) ) , e ) ; } }
Source:
public void changeAssigneeToSelfOnReviewableChangeInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , sc.owner , sc.assignee ) ; sender.clear ( ) ; assign ( sc , sc.owner , sc.owner ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer , sc.assignee ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) ; }

Target:
public void changeAssigneeToSelfOnReviewableChangeInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , sc.owner , sc.assignee ) ; sender.clear ( ) ; assign ( sc , sc.owner , sc.owner ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer , sc.assignee ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) ; }
Source:
private org.eclipse.jgit.revwalk.RevCommit writeCommit ( java.lang.String body ) throws java.lang.Exception { com.google.gerrit.server.notedb.ChangeNoteUtil noteUtil = injector.getInstance ( com.google.gerrit.server.notedb.ChangeNoteUtil.class ) ; return writeCommit ( body , noteUtil.newIdent ( changeOwner.getAccount ( ) , com.google.gerrit.common.TimeUtil.nowTs ( ) , serverIdent , "Anonymous Coward" ) , false ) ; }

Target:
private org.eclipse.jgit.revwalk.RevCommit writeCommit ( java.lang.String body ) throws java.lang.Exception { com.google.gerrit.server.notedb.ChangeNoteUtil noteUtil = injector.getInstance ( com.google.gerrit.server.notedb.ChangeNoteUtil.class ) ; return writeCommit ( body , noteUtil.newIdent ( changeOwner.getAccount ( ) , com.google.gerrit.common.TimeUtil.nowTs ( ) , serverIdent ) , false ) ; }
Source:
public boolean hasNext ( ) { while ( ( ( next ) == null ) && ( itr.hasNext ( ) ) ) { com.google.inject.Provider < T > p = itr.next ( ) . get ( ) ; if ( p != null ) { try { next = p.get ( ) ; } catch ( java.lang.RuntimeException e ) { com.google.gerrit.extensions.registration.DynamicSet.log.error ( ( ( "Cannot get iterated object from provider " + p ) + ": object discared" ) , e ) ; } } } return ( next ) != null ; }

Target:
public boolean hasNext ( ) { while ( ( ( next ) == null ) && ( itr.hasNext ( ) ) ) { com.google.inject.Provider < T > p = itr.next ( ) . get ( ) ; if ( p != null ) { try { next = p.get ( ) ; } catch ( java.lang.RuntimeException e ) { } } } return ( next ) != null ; }
Source:
public final void copyTo ( com.google.gerrit.extensions.client.EditPreferencesInfo p ) { p.tabSize = tabSize ( ) ; p.lineLength = lineLength ( ) ; p.cursorBlinkRate = cursorBlinkRate ( ) ; p.hideTopMenu = hideTopMenu ( ) ; p.showTabs = showTabs ( ) ; p.showWhitespaceErrors = showWhitespaceErrors ( ) ; p.syntaxHighlighting = syntaxHighlighting ( ) ; p.hideLineNumbers = hideLineNumbers ( ) ; p.matchBrackets = matchBrackets ( ) ; p.autoCloseBrackets = autoCloseBrackets ( ) ; p.theme = theme ( ) ; p.keyMapType = keyMapType ( ) ; }

Target:
public final com.google.gerrit.extensions.client.EditPreferencesInfo copyTo ( com.google.gerrit.extensions.client.EditPreferencesInfo p ) { p.tabSize = tabSize ( ) ; p.lineLength = lineLength ( ) ; p.cursorBlinkRate = cursorBlinkRate ( ) ; p.hideTopMenu = hideTopMenu ( ) ; p.showTabs = showTabs ( ) ; p.showWhitespaceErrors = showWhitespaceErrors ( ) ; p.syntaxHighlighting = syntaxHighlighting ( ) ; p.hideLineNumbers = hideLineNumbers ( ) ; p.matchBrackets = matchBrackets ( ) ; p.autoCloseBrackets = autoCloseBrackets ( ) ; p.theme = theme ( ) ; p.keyMapType = keyMapType ( ) ; return p ; }
Source:
public static void applyUserPreferences ( ) { if ( ( com.google.gerrit.client.Gerrit.myAccount ) != null ) { final com.google.gerrit.reviewdb.AccountGeneralPreferences p = com.google.gerrit.client.Gerrit.myAccount.getGeneralPreferences ( ) ; com.google.gwtexpui.clippy.client.CopyableLabel.setFlashEnabled ( p.isUseFlashClipboard ( ) ) ; com.google.gerrit.client.Gerrit.siteHeader.setVisible ( p.isShowSiteHeader ( ) ) ; com.google.gerrit.client.Gerrit.siteFooter.setVisible ( p.isShowSiteHeader ( ) ) ; } }

Target:
public static void applyUserPreferences ( ) { if ( ( com.google.gerrit.client.Gerrit.myAccount ) != null ) { final com.google.gerrit.reviewdb.AccountGeneralPreferences p = com.google.gerrit.client.Gerrit.myAccount.getGeneralPreferences ( ) ; com.google.gwtexpui.clippy.client.CopyableLabel.setFlashEnabled ( p.isUseFlashClipboard ( ) ) ; if ( ( com.google.gerrit.client.Gerrit.siteHeader ) != null ) { com.google.gerrit.client.Gerrit.siteHeader.setVisible ( p.isShowSiteHeader ( ) ) ; } if ( ( com.google.gerrit.client.Gerrit.siteFooter ) != null ) { com.google.gerrit.client.Gerrit.siteFooter.setVisible ( p.isShowSiteHeader ( ) ) ; } } }
Source:
public void receivePackRespectsVisibilityOfOpenChanges ( ) throws java.lang.Exception { allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/master" ) ; deny ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/branch" ) ; setApiUser ( user ) ; com.google.common.truth.Truth.assertThat ( getReceivePackRefs ( ) . additionalHaves ( ) ) . containsExactly ( com.google.gerrit.acceptance.git.RefAdvertisementIT.obj ( c3 , 1 ) ) ; }

Target:
public void receivePackRespectsVisibilityOfOpenChanges ( ) throws java.lang.Exception { allow ( "refs/heads/master" , Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; deny ( "refs/heads/branch" , Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; setApiUser ( user ) ; com.google.common.truth.Truth.assertThat ( getReceivePackRefs ( ) . additionalHaves ( ) ) . containsExactly ( com.google.gerrit.acceptance.git.RefAdvertisementIT.obj ( c3 , 1 ) ) ; }
Source:
public com.google.gerrit.server.plugins.ServerPlugin get ( java.lang.String name , java.io.File srcFile , com.google.gerrit.server.PluginUser pluginUser , org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot , java.lang.String pluginCanonicalWebUrl , java.io.File pluginDataDir ) throws com.google.gerrit.server.plugins.InvalidPluginException { com.googlesource.gerrit.plugins.scripting.groovyprovider.GroovyPluginScriptEngine scriptEngine = scriptEngineProvider.get ( ) ; return new com.google.gerrit.server.plugins.ServerPlugin ( getPluginName ( srcFile ) , pluginCanonicalWebUrl , pluginUser , srcFile , snapshot , new com.googlesource.gerrit.plugins.scripting.groovyprovider.GroovyPluginScanner ( getPluginName ( srcFile ) , scriptEngine , srcFile ) , pluginDataDir , scriptEngine.getGroovyClassLoader ( ) ) ; }

Target:
public com.google.gerrit.server.plugins.ServerPlugin get ( java.io.File srcFile , com.google.gerrit.server.PluginUser pluginUser , org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot , java.lang.String pluginCanonicalWebUrl , java.io.File pluginDataDir ) throws com.google.gerrit.server.plugins.InvalidPluginException { com.googlesource.gerrit.plugins.scripting.groovyprovider.GroovyPluginScriptEngine scriptEngine = scriptEngineProvider.get ( ) ; return new com.google.gerrit.server.plugins.ServerPlugin ( getPluginName ( srcFile ) , pluginCanonicalWebUrl , pluginUser , srcFile , snapshot , new com.googlesource.gerrit.plugins.scripting.groovyprovider.GroovyPluginScanner ( getPluginName ( srcFile ) , scriptEngine , srcFile ) , pluginDataDir , scriptEngine.getGroovyClassLoader ( ) ) ; }
Source:
com.google.gitiles.GitilesServlet getServlet ( @ com.google.inject.name.Named ( value = "gitiles" ) org.eclipse.jgit.lib.Config cfg , com.google.gitiles.GitilesUrls urls , com.google.gitiles.GitilesAccess.Factory accessFactory , org.eclipse.jgit.transport.resolver.RepositoryResolver < javax.servlet.http.HttpServletRequest > resolver , com.googlesource.gerrit.plugins.gitiles.MenuFilter menuFilter ) throws javax.servlet.ServletException { com.google.gitiles.GitilesServlet s = new com.google.gitiles.GitilesServlet ( cfg , null , urls , accessFactory , resolver , null , null , null ) ; for ( com.google.gitiles.GitilesView.Type view : GitilesView.Type.values ( ) ) { s.addFilter ( view , menuFilter ) ; } return s ; }

Target:
com.google.gitiles.GitilesServlet getServlet ( @ com.google.inject.name.Named ( value = "gitiles" ) org.eclipse.jgit.lib.Config cfg , com.google.gitiles.GitilesUrls urls , com.google.gitiles.GitilesAccess.Factory accessFactory , org.eclipse.jgit.transport.resolver.RepositoryResolver < javax.servlet.http.HttpServletRequest > resolver , com.googlesource.gerrit.plugins.gitiles.MenuFilter menuFilter ) throws javax.servlet.ServletException { com.google.gitiles.GitilesServlet s = new com.google.gitiles.GitilesServlet ( cfg , null , urls , accessFactory , resolver , null , null , null , null ) ; for ( com.google.gitiles.GitilesView.Type view : GitilesView.Type.values ( ) ) { s.addFilter ( view , menuFilter ) ; } return s ; }
Source:
private void merge ( com.google.gerrit.acceptance.PushOneCommit.Result r ) throws java.lang.Exception { revision ( r ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) ) ; revision ( r ) . submit ( ) ; org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ; try { com.google.common.truth.Truth.assertThat ( repo.getRef ( "refs/heads/master" ) . getObjectId ( ) ) . isEqualTo ( r.getCommitId ( ) ) ; } finally { repo.close ( ) ; } }

Target:
private void merge ( com.google.gerrit.acceptance.PushOneCommit.Result r ) throws java.lang.Exception { revision ( r ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) ) ; revision ( r ) . submit ( ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ) { com.google.common.truth.Truth.assertThat ( repo.getRef ( "refs/heads/master" ) . getObjectId ( ) ) . isEqualTo ( r.getCommitId ( ) ) ; } }
Source:
public void deleteVoteFromReviewableChangeByAdminCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; setEmailStrategy ( admin , EmailStrategy.CC_ON_OWN_COMMENTS ) ; setApiUser ( admin ) ; deleteVote ( sc , voter ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . to ( sc.owner ) . to ( sc.reviewerByEmail ) . cc ( sc.reviewer , sc.ccer , admin , voter ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteVoteFromReviewableChangeByAdminCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; setEmailStrategy ( admin , EmailStrategy.CC_ON_OWN_COMMENTS ) ; setApiUser ( admin ) ; deleteVote ( sc , voter ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer , admin , voter ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }
Source:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.exceptions.PrologException { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 = arg1.dereference ( ) ; com.google.gerrit.server.project.ProjectState projectState = StoredValues.PROJECT_STATE.get ( engine ) ; com.google.gerrit.extensions.client.SubmitType submitType = projectState.getProject ( ) . getSubmitType ( ) ; if ( ! ( a1.unify ( gerrit.PRED_project_default_submit_type_1.term [ submitType.ordinal ( ) ] , engine.trail ) ) ) { return engine.fail ( ) ; } return cont ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.exceptions.PrologException { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 = arg1.dereference ( ) ; com.google.gerrit.server.project.ProjectState projectState = StoredValues.PROJECT_STATE.get ( engine ) ; com.google.gerrit.extensions.client.SubmitType submitType = projectState.getSubmitType ( ) ; if ( ! ( a1.unify ( gerrit.PRED_project_default_submit_type_1.term [ submitType.ordinal ( ) ] , engine.trail ) ) ) { return engine.fail ( ) ; } return cont ; }
Source:
public void setAssigneeAllowedWithPermission ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; grant ( Permission.EDIT_ASSIGNEE , project , "refs/heads/master" , false , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; setApiUser ( user ) ; com.google.common.truth.Truth.assertThat ( setAssignee ( r , user.email ) . _accountId ) . isEqualTo ( user.getId ( ) . get ( ) ) ; }

Target:
public void setAssigneeAllowedWithPermission ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; grant ( project , "refs/heads/master" , Permission.EDIT_ASSIGNEE , false , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; setApiUser ( user ) ; com.google.common.truth.Truth.assertThat ( setAssignee ( r , user.email ) . _accountId ) . isEqualTo ( user.getId ( ) . get ( ) ) ; }
Source:
public void onLoad ( ) { if ( ( info ) == null ) { initUI ( ) ; } super . onLoad ( ) ; display ( com.google.gerrit.client.Gerrit.getUserAccount ( ) ) ; tabs.selectTab ( tabTokens.indexOf ( initialTabToken ) ) ; Util.ACCOUNT_SVC.myAccount ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.reviewdb.Account > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.client.reviewdb.Account result ) { display ( result ) ; } } ) ; }

Target:
public void onLoad ( ) { super . onLoad ( ) ; Util.ACCOUNT_SVC.myAccount ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.reviewdb.Account > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.client.reviewdb.Account result ) { display ( result ) ; tabs.selectTab ( tabTokens.indexOf ( initialTabToken ) ) ; } } ) ; }
Source:
private java.util.Collection < com.google.gerrit.server.config.ListCaches.CacheInfo > getCaches ( ) { java.util.Map < java.lang.String , com.google.gerrit.server.config.ListCaches.CacheInfo > caches = listCaches.get ( ) . apply ( new com.google.gerrit.server.config.ConfigResource ( ) ) ; for ( java.util.Map.Entry < java.lang.String , com.google.gerrit.server.config.ListCaches.CacheInfo > entry : caches.entrySet ( ) ) { com.google.gerrit.server.config.ListCaches.CacheInfo cache = entry.getValue ( ) ; if ( ( cache.type ) == null ) { cache.type = com.google.gerrit.server.config.ListCaches.CacheType.MEM ; } cache.name = entry.getKey ( ) ; } return caches.values ( ) ; }

Target:
private java.util.Collection < com.google.gerrit.server.config.ListCaches.CacheInfo > getCaches ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Map < java.lang.String , com.google.gerrit.server.config.ListCaches.CacheInfo > caches = ( ( java.util.Map < java.lang.String , com.google.gerrit.server.config.ListCaches.CacheInfo > ) ( listCaches.get ( ) . apply ( new com.google.gerrit.server.config.ConfigResource ( ) ) ) ) ; for ( java.util.Map.Entry < java.lang.String , com.google.gerrit.server.config.ListCaches.CacheInfo > entry : caches.entrySet ( ) ) { com.google.gerrit.server.config.ListCaches.CacheInfo cache = entry.getValue ( ) ; cache.name = entry.getKey ( ) ; } return caches.values ( ) ; }
Source:
public void contributorAgreements ( final com.google.gwt.user.client.rpc.AsyncCallback < java.util.List < com.google.gerrit.client.reviewdb.ContributorAgreement > > callback ) { try { final com.google.gerrit.client.reviewdb.ReviewDb db = com.google.gerrit.client.rpc.Common.getSchemaFactory ( ) . open ( ) ; try { callback.onSuccess ( db.contributorAgreements ( ) . active ( ) . toList ( ) ) ; } finally { db.close ( ) ; } } catch ( com.google.gwtorm.client.OrmException e ) { callback.onFailure ( e ) ; } }

Target:
public void contributorAgreements ( final com.google.gwt.user.client.rpc.AsyncCallback < java.util.List < com.google.gerrit.client.reviewdb.ContributorAgreement > > callback ) { try { final com.google.gerrit.client.reviewdb.ReviewDb db = server.getSchemaFactory ( ) . open ( ) ; try { callback.onSuccess ( db.contributorAgreements ( ) . active ( ) . toList ( ) ) ; } finally { db.close ( ) ; } } catch ( com.google.gwtorm.client.OrmException e ) { callback.onFailure ( e ) ; } }
Source:
public com.google.gerrit.server.patch.PatchList get ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet patchSet ) throws com.google.gerrit.server.patch.PatchListNotAvailableException { com.google.gerrit.reviewdb.client.Project.NameKey project = change.getProject ( ) ; org.eclipse.jgit.lib.ObjectId a = null ; if ( ( patchSet.getRevision ( ) ) == null ) { throw new com.google.gerrit.server.patch.PatchListNotAvailableException ( ( "revision is null for " + ( patchSet.getId ( ) ) ) ) ; } org.eclipse.jgit.lib.ObjectId b = org.eclipse.jgit.lib.ObjectId.fromString ( patchSet.getRevision ( ) . get ( ) ) ; com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace ws = com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace.IGNORE_NONE ; return get ( new com.google.gerrit.server.patch.PatchListKey ( a , b , ws ) , project ) ; }

Target:
public com.google.gerrit.server.patch.PatchList get ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet patchSet ) throws com.google.gerrit.server.patch.PatchListNotAvailableException { com.google.gerrit.reviewdb.client.Project.NameKey project = change.getProject ( ) ; if ( ( patchSet.getRevision ( ) ) == null ) { throw new com.google.gerrit.server.patch.PatchListNotAvailableException ( ( "revision is null for " + ( patchSet.getId ( ) ) ) ) ; } org.eclipse.jgit.lib.ObjectId b = org.eclipse.jgit.lib.ObjectId.fromString ( patchSet.getRevision ( ) . get ( ) ) ; com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace ws = com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace.IGNORE_NONE ; return get ( new com.google.gerrit.server.patch.PatchListKey ( null , b , ws ) , project ) ; }
Source:
public void onSuccess ( com.googlesource.gerrit.plugins.serviceuser.client.AccountCapabilities ac ) { boolean isAdmin = ac.canPerform ( "administrateServer" ) ; display ( serviceUserInfo , httpPassword.asString ( ) , ( ( configInfo.getAllowEmail ( ) ) || isAdmin ) , ( ( configInfo.getAllowOwner ( ) ) || isAdmin ) , ( ( configInfo.getAllowHttpPassword ( ) ) || isAdmin ) ) ; }

Target:
public void onSuccess ( com.googlesource.gerrit.plugins.serviceuser.client.AccountCapabilities ac ) { boolean isAdmin = ac.canPerform ( "administrateServer" ) ; display ( serviceUserInfo , ( ( configInfo.getAllowEmail ( ) ) || isAdmin ) , ( ( configInfo.getAllowOwner ( ) ) || isAdmin ) , ( ( configInfo.getAllowHttpPassword ( ) ) || isAdmin ) ) ; }
Source:
protected com.google.gerrit.extensions.conditions.BooleanCondition canDeletePrivate ( com.google.gerrit.server.change.ChangeResource rsrc ) { com.google.gerrit.server.permissions.PermissionBackend.WithUser user = permissionBackend.user ( rsrc.getUser ( ) ) ; return com.google.gerrit.extensions.conditions.BooleanCondition.or ( ( ( rsrc.isUserOwner ( ) ) && ( ( rsrc.getChange ( ) . getStatus ( ) ) != ( Change.Status.MERGED ) ) ) , user.testCond ( GlobalPermission.ADMINISTRATE_SERVER ) ) ; }

Target:
protected com.google.gerrit.extensions.conditions.BooleanCondition canDeletePrivate ( com.google.gerrit.server.change.ChangeResource rsrc ) { com.google.gerrit.server.permissions.PermissionBackend.WithUser user = permissionBackend.user ( rsrc.getUser ( ) ) ; return com.google.gerrit.extensions.conditions.BooleanCondition.or ( rsrc.isUserOwner ( ) , user.testCond ( GlobalPermission.ADMINISTRATE_SERVER ) ) ; }
Source:
private boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.CurrentUser user , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.project.ProjectState pe = projectCache.get ( change.getProject ( ) ) ; if ( pe == null ) { return false ; } com.google.gerrit.server.project.ProjectControl pc = pe.controlFor ( user ) ; return pc.controlFor ( change ) . isVisible ( db ) ; }

Target:
private boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.CurrentUser user , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( change == null ) { return false ; } com.google.gerrit.server.project.ProjectState pe = projectCache.get ( change.getProject ( ) ) ; if ( pe == null ) { return false ; } com.google.gerrit.server.project.ProjectControl pc = pe.controlFor ( user ) ; return pc.controlFor ( db , change ) . isVisible ( db ) ; }
Source:
public void setUpInjector ( ) throws java.lang.Exception { com.google.inject.Injector injector = createInjector ( ) ; injector.injectMembers ( this ) ; lifecycle = new com.google.gerrit.lifecycle.LifecycleManager ( ) ; lifecycle.add ( injector ) ; lifecycle.start ( ) ; db = schemaFactory.open ( ) ; schemaCreator.create ( db ) ; userId = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "user" ) ) . getAccountId ( ) ; com.google.gerrit.reviewdb.client.Account userAccount = db.accounts ( ) . get ( userId ) ; userAccount.setPreferredEmail ( "user@example.com" ) ; db.accounts ( ) . update ( com.google.common.collect.ImmutableList.of ( userAccount ) ) ; user = userFactory.create ( userId ) ; requestContext.setContext ( newRequestContext ( userAccount.getId ( ) ) ) ; }

Target:
public void setUpInjector ( ) throws java.lang.Exception { lifecycle = new com.google.gerrit.lifecycle.LifecycleManager ( ) ; com.google.inject.Injector injector = createInjector ( lifecycle ) ; injector.injectMembers ( this ) ; lifecycle.start ( ) ; db = schemaFactory.open ( ) ; schemaCreator.create ( db ) ; userId = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "user" ) ) . getAccountId ( ) ; com.google.gerrit.reviewdb.client.Account userAccount = db.accounts ( ) . get ( userId ) ; userAccount.setPreferredEmail ( "user@example.com" ) ; db.accounts ( ) . update ( com.google.common.collect.ImmutableList.of ( userAccount ) ) ; user = userFactory.create ( userId ) ; requestContext.setContext ( newRequestContext ( userAccount.getId ( ) ) ) ; }
Source:
public void setAssigneeToSelfOnReviewableChangeInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , sc.owner , sc.owner ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer , sc.assignee ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) ; }

Target:
public void setAssigneeToSelfOnReviewableChangeInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , sc.owner , sc.owner ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer , sc.assignee ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) ; }
Source:
public java.lang.Boolean call ( ) { try ( com.google.gerrit.reviewdb.server.ReviewDb db = com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( schemaFactory.open ( ) ) ) { return rebuilder.rebuildProject ( db , changesByProject , project , allUsersRepo ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.pgm.RebuildNoteDb.log.error ( ( "Error rebuilding project " + project ) , e ) ; return false ; } }

Target:
public java.lang.Boolean call ( ) { try ( com.google.gerrit.reviewdb.server.ReviewDb db = com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( schemaFactory.open ( ) ) ) { return rebuildProject ( db , changesByProject , project , allUsersRepo ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.pgm.RebuildNoteDb.log.error ( ( "Error rebuilding project " + project ) , e ) ; return false ; } }
Source:
public void testAppend_long ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; assertSame ( b , b.append ( 4L ) ) ; assertSame ( b , b.append ( 2L ) ) ; assertEquals ( "42" , b.asString ( ) ) ; }

Target:
public void testAppend_long ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.append ( 4L ) ) ; org.junit.Assert.assertSame ( b , b.append ( 2L ) ) ; org.junit.Assert.assertEquals ( "42" , b.asString ( ) ) ; }
Source:
public com.google.common.util.concurrent.ListenableFuture < java.lang.Object > apply ( java.lang.Boolean indexUpdated ) throws java.lang.Exception { if ( ! indexUpdated ) { return ( ( com.google.common.util.concurrent.ListenableFuture < java.lang.Object > ) ( indexer.indexAsync ( id ) ) ) ; } return com.google.common.util.concurrent.Futures.immediateFuture ( null ) ; }

Target:
public com.google.common.util.concurrent.ListenableFuture < java.lang.Object > apply ( java.lang.Boolean indexUpdated ) throws java.lang.Exception { if ( ! indexUpdated ) { return ( ( com.google.common.util.concurrent.ListenableFuture < java.lang.Object > ) ( indexer.indexAsync ( c.getId ( ) ) ) ) ; } return com.google.common.util.concurrent.Futures.immediateFuture ( null ) ; }
Source:
private java.util.concurrent.Callable < com.google.gerrit.httpd.raw.ResourceServlet.Resource > newLoader ( final java.nio.file.Path p ) { return new java.util.concurrent.Callable < com.google.gerrit.httpd.raw.ResourceServlet.Resource > ( ) { @ java.lang.Override public com.google.gerrit.httpd.raw.ResourceServlet.Resource call ( ) throws java.io.IOException { try { return new com.google.gerrit.httpd.raw.ResourceServlet.Resource ( getLastModifiedTime ( p ) , com.google.gerrit.httpd.raw.ResourceServlet.contentType ( p.toString ( ) ) , java.nio.file.Files.readAllBytes ( p ) ) ; } catch ( java.nio.file.NoSuchFileException e ) { return com.google.gerrit.httpd.raw.ResourceServlet.Resource.NOT_FOUND ; } } } ; }

Target:
private java.util.concurrent.Callable < com.google.gerrit.httpd.raw.ResourceServlet.Resource > newLoader ( final java.nio.file.Path p ) { return ( ) -> { try { return new com.google.gerrit.httpd.raw.ResourceServlet.Resource ( getLastModifiedTime ( p ) , com.google.gerrit.httpd.raw.ResourceServlet.contentType ( p.toString ( ) ) , java.nio.file.Files.readAllBytes ( p ) ) ; } catch ( java.nio.file.NoSuchFileException e ) { return com.google.gerrit.httpd.raw.ResourceServlet.Resource.NOT_FOUND ; } } ; }
Source:
public void run ( ) { net.codemirror.lib.CodeMirror.LineHandle handle = cm.extras ( ) . activeLine ( ) ; int line = ( cm.getLineNumber ( handle ) ) + 1 ; com.google.gerrit.client.editor.EditScreen.scrollToLine ( line ) ; java.lang.String token = com.google.gerrit.client.Dispatcher.toEditScreen ( revision , path ) ; if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( token ) ; } else { com.google.gerrit.client.Gerrit.display ( token ) ; } }

Target:
public void run ( ) { net.codemirror.lib.CodeMirror.LineHandle handle = cm.extras ( ) . activeLine ( ) ; int line = ( cm.getLineNumber ( handle ) ) + 1 ; java.lang.String token = com.google.gerrit.client.Dispatcher.toEditScreen ( revision , path , line ) ; if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( token ) ; } else { com.google.gerrit.client.Gerrit.display ( token ) ; } }
Source:
public com.google.gwtorm.server.ResultSet < com.google.gwtorm.nosql.generic.Row > fetchRows ( java.lang.Iterable < byte [ ] > keys ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gwtorm.nosql.generic.Row > r = new java.util.ArrayList < com.google.gwtorm.nosql.generic.Row > ( ) ; for ( byte [ ] key : keys ) { byte [ ] val = fetchRow ( key ) ; if ( val != null ) { r.add ( new com.google.gwtorm.nosql.generic.Row ( key , val ) ) ; } } return new com.google.gwtorm.server.ListResultSet < com.google.gwtorm.nosql.generic.Row > ( r ) ; }

Target:
public com.google.gwtorm.server.ResultSet < com.google.gwtorm.nosql.generic.Row > fetchRows ( java.lang.Iterable < byte [ ] > keys ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gwtorm.nosql.generic.Row > r = new java.util.ArrayList < > ( ) ; for ( byte [ ] key : keys ) { byte [ ] val = fetchRow ( key ) ; if ( val != null ) { r.add ( new com.google.gwtorm.nosql.generic.Row ( key , val ) ) ; } } return new com.google.gwtorm.server.ListResultSet ( r ) ; }
Source:
private org.eclipse.jgit.revwalk.RevCommit nextUnchecked ( ) { try { return next ( ) ; } catch ( org.eclipse.jgit.errors.MissingObjectException e ) { throw new org.eclipse.jgit.errors.RevWalkException ( e ) ; } catch ( org.eclipse.jgit.errors.IncorrectObjectTypeException e ) { throw new org.eclipse.jgit.errors.RevWalkException ( e ) ; } catch ( java.io.IOException e ) { throw new org.eclipse.jgit.errors.RevWalkException ( e ) ; } }

Target:
private org.eclipse.jgit.revwalk.RevCommit nextUnchecked ( ) { try { return next ( ) ; } catch ( java.io.IOException e ) { throw new org.eclipse.jgit.errors.RevWalkException ( e ) ; } }
Source:
public com.google.gerrit.reviewdb.AccountGroup missing ( final com.google.gerrit.reviewdb.AccountGroup.Id key ) { final com.google.gerrit.reviewdb.AccountGroup.NameKey name = new com.google.gerrit.reviewdb.AccountGroup.NameKey ( ( "Deleted Group" + ( key.toString ( ) ) ) ) ; final com.google.gerrit.reviewdb.AccountGroup g = new com.google.gerrit.reviewdb.AccountGroup ( name , key ) ; g.setType ( AccountGroup.Type.SYSTEM ) ; g.setOwnerGroupId ( administrators ) ; return g ; }

Target:
public com.google.gerrit.reviewdb.AccountGroup missing ( final com.google.gerrit.reviewdb.AccountGroup.Id key ) { final com.google.gerrit.reviewdb.AccountGroup.NameKey name = new com.google.gerrit.reviewdb.AccountGroup.NameKey ( ( "Deleted Group" + ( key.toString ( ) ) ) ) ; final com.google.gerrit.reviewdb.AccountGroup g = new com.google.gerrit.reviewdb.AccountGroup ( name , key , null ) ; g.setType ( AccountGroup.Type.SYSTEM ) ; g.setOwnerGroupId ( administrators ) ; return g ; }
Source:
protected void configureServlets ( ) { install ( new com.google.gerrit.httpd.ProjectServlet.Module ( ) ) ; filter ( "/p/*" ) . through ( com.google.gerrit.httpd.ProjectAccessPathFilter.class ) ; if ( authConfig.isTrustContainerAuth ( ) ) { filter ( "/p/*" ) . through ( com.google.gerrit.httpd.ContainerAuthFilter.class ) ; } else { filter ( "/p/*" ) . through ( com.google.gerrit.httpd.ProjectDigestFilter.class ) ; } serve ( "/p/*" ) . with ( com.google.gerrit.httpd.ProjectServlet.class ) ; }

Target:
protected void configureServlets ( ) { filter ( "/p/*" ) . through ( com.google.gerrit.httpd.ProjectAccessPathFilter.class ) ; if ( authConfig.isTrustContainerAuth ( ) ) { filter ( "/p/*" ) . through ( com.google.gerrit.httpd.ContainerAuthFilter.class ) ; } else { filter ( "/p/*" ) . through ( com.google.gerrit.httpd.ProjectDigestFilter.class ) ; } serve ( "/p/*" ) . with ( com.google.gerrit.httpd.ProjectServlet.class ) ; }