auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void allOpenPrev ( final java.lang.String pos , final int pageSize , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.SingleListChangeInfo > callback ) { run ( callback , new com.google.gerrit.httpd.rpc.ChangeListServiceImpl.QueryPrev ( pageSize , pos ) { @ java.lang.Override com.google.gwtorm.client.ResultSet < com.google.gerrit.reviewdb.Change > query ( com.google.gerrit.reviewdb.ReviewDb db , int slim , java.lang.String sortKey ) throws com.google.gwtorm.client.OrmException { return db.changes ( ) . allOpenPrev ( sortKey , slim ) ; } } ) ; }

Target:
public void allQueryPrev ( final java.lang.String query , final java.lang.String pos , final int pageSize , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.SingleListChangeInfo > callback ) { run ( callback , new com.google.gerrit.httpd.rpc.ChangeListServiceImpl.QueryPrev ( pageSize , pos ) { @ java.lang.Override com.google.gwtorm.client.ResultSet < com.google.gerrit.reviewdb.Change > query ( com.google.gerrit.reviewdb.ReviewDb db , int lim , java.lang.String key ) throws com.google.gerrit.common.errors.InvalidQueryException , com.google.gwtorm.client.OrmException { return searchQuery ( db , query , lim , key , com.google.gerrit.httpd.rpc.ChangeListServiceImpl.QUERY_PREV ) ; } } ) ; }
Source:
public void importPullRequest ( int idx , java.lang.String organisation , java.lang.String repoName , int pullRequestId , com.googlesrouce.gerrit.plugins.github.git.PullRequestImportType importType ) { try { com.googlesrouce.gerrit.plugins.github.git.PullRequestImportJob pullRequestImportJob = prImportJobProvider.create ( idx , organisation , repoName , pullRequestId , importType ) ; com.googlesrouce.gerrit.plugins.github.git.PullRequestImporter.log.debug ( ( "New Pull request import job created: " + pullRequestImportJob ) ) ; schedule ( idx , pullRequestImportJob ) ; } catch ( java.lang.Throwable e ) { schedule ( idx , new com.googlesrouce.gerrit.plugins.github.git.ErrorJob ( idx , organisation , repoName , e ) ) ; } }

Target:
public void importPullRequest ( int idx , java.lang.String organisation , java.lang.String repoName , int pullRequestId , com.googlesource.gerrit.plugins.github.git.PullRequestImportType importType ) { try { com.googlesource.gerrit.plugins.github.git.PullRequestImportJob pullRequestImportJob = prImportJobProvider.create ( idx , organisation , repoName , pullRequestId , importType ) ; com.googlesource.gerrit.plugins.github.git.PullRequestImporter.log.debug ( ( "New Pull request import job created: " + pullRequestImportJob ) ) ; schedule ( idx , pullRequestImportJob ) ; } catch ( java.lang.Throwable e ) { schedule ( idx , new com.googlesource.gerrit.plugins.github.git.ErrorJob ( idx , organisation , repoName , e ) ) ; } }
Source:
public boolean execute ( ) { if ( ( prefs.syntaxHighlighting ( ) ) && ( isAttached ( ) ) ) { setSyntaxHighlighting ( prefs.syntaxHighlighting ( ) ) ; } return false ; }

Target:
public void run ( ) { int height = ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - ( ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + 18 ) ; cmA.setHeight ( height ) ; cmB.setHeight ( height ) ; render ( diff ) ; commentManager.render ( comments , prefs.expandAllComments ( ) ) ; skipManager.render ( prefs.context ( ) , diff ) ; }
Source:
public void testUpsertTwoUpdateCountsAreNull ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , null ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , 1 , 1 ) ; createClassUnderTest ( ) . upsert ( twoRows ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( insert ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertExpectedIdsUsed ( insert , 1 , 2 ) ; }

Target:
public void upsertTwoSecondExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE , 0 , 1 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.INSERT , 1 ) ; classUnderTest.upsert ( twoRows ) ; assertCorrectUpdating ( update , 1 , 2 ) ; assertCorrectUpdating ( insert , 1 ) ; }
Source:
public void advertisedReferencesIncludeAllUserBranchesWithAccessDatabase ( ) throws java.lang.Exception { allowGlobalCapabilities ( com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , GlobalCapability.ACCESS_DATABASE ) ; try { org.eclipse.jgit.junit.TestRepository < ? > userTestRepository = cloneProject ( allUsers , user ) ; try ( org.eclipse.jgit.api.Git git = userTestRepository.git ( ) ) { com.google.common.truth.Truth.assertThat ( getUserRefs ( git ) ) . containsExactly ( com.google.gerrit.reviewdb.client.RefNames.refsUsers ( user.id ) , com.google.gerrit.reviewdb.client.RefNames.refsUsers ( admin.id ) ) ; } } finally { removeGlobalCapabilities ( com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , GlobalCapability.ACCESS_DATABASE ) ; } }

Target:
public void advertisedReferencesIncludeAllUserBranchesWithAccessDatabase ( ) throws java.lang.Exception { allowGlobalCapabilities ( com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , GlobalCapability.ACCESS_DATABASE ) ; try { org.eclipse.jgit.junit.TestRepository < ? > userTestRepository = cloneProject ( allUsers , user ) ; try ( org.eclipse.jgit.api.Git git = userTestRepository.git ( ) ) { com.google.common.truth.Truth.assertThat ( getUserRefs ( git ) ) . containsExactly ( RefNames.REFS_USERS_SELF , com.google.gerrit.reviewdb.client.RefNames.refsUsers ( user.id ) , com.google.gerrit.reviewdb.client.RefNames.refsUsers ( admin.id ) ) ; } } finally { removeGlobalCapabilities ( com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , GlobalCapability.ACCESS_DATABASE ) ; } }
Source:
protected void configure ( ) { serverConfig = createMock ( org.eclipse.jgit.lib.Config.class ) ; bind ( org.eclipse.jgit.lib.Config.class ) . annotatedWith ( com.google.gerrit.server.config.GerritServerConfig.class ) . toInstance ( serverConfig ) ; }

Target:
protected void configure ( ) { serverConfig = createMock ( org.eclipse.jgit.lib.Config.class ) ; bind ( org.eclipse.jgit.lib.Config.class ) . annotatedWith ( com.google.gerrit.server.config.GerritServerConfig.class ) . toInstance ( serverConfig ) ; bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.PluginName.class ) . toInstance ( "its-bugzilla" ) ; }
Source:
private java.util.List < com.google.gerrit.common.data.SubmitRecord > invalidResult ( com.googlecode.prolog_cafe.lang.Term rule , com.googlecode.prolog_cafe.lang.Term record , java.lang.String reason ) { return ruleError ( ( ( ( ( ( ( ( ( "Submit rule " + rule ) + " for change " ) + ( cd.getId ( ) ) ) + " of " ) + ( getProjectName ( ) ) ) + " output invalid result: " ) + record ) + ( reason == null ? "" : ". Reason: " + reason ) ) ) ; }

Target:
private java.util.List < com.google.gerrit.common.data.SubmitRecord > invalidResult ( com.googlecode.prolog_cafe.lang.Term rule , com.googlecode.prolog_cafe.lang.Term record , java.lang.String reason ) { return ruleError ( java.lang.String.format ( ( "Submit rule %s for change %s of %s output " + "invalid result: %s%s" ) , rule , cd.getId ( ) , getProjectName ( ) , record , ( reason == null ? "" : ". Reason: " + reason ) ) ) ; }
Source:
public java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > apply ( com.google.gerrit.server.change.ChangeResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ! ( self.get ( ) . isIdentifiedUser ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } return reviewersUtil.suggestReviewers ( rsrc.getNotes ( ) , this , rsrc.getControl ( ) . getProjectControl ( ) . getProjectState ( ) , getVisibility ( rsrc ) , excludeGroups ) ; }

Target:
public java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > apply ( com.google.gerrit.server.change.ChangeResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ! ( self.get ( ) . isIdentifiedUser ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } return reviewersUtil.suggestReviewers ( rsrc.getNotes ( ) , this , projectCache.checkedGet ( rsrc.getProject ( ) ) , getVisibility ( rsrc ) , excludeGroups ) ; }
Source:
public static org.eclipse.jgit.lib.Config loadDefault ( javax.servlet.FilterConfig filterConfig ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { java.lang.String configPath = null ; if ( filterConfig != null ) { configPath = filterConfig.getInitParameter ( com.google.gitiles.GitilesConfig.FILTER_CONFIG_PARAM ) ; } if ( configPath == null ) { configPath = java.lang.System.getProperty ( com.google.gitiles.GitilesConfig.PROPERTY_NAME , com.google.gitiles.GitilesConfig.DEFAULT_PATH ) ; } org.eclipse.jgit.storage.file.FileBasedConfig config = new org.eclipse.jgit.storage.file.FileBasedConfig ( new java.io.File ( configPath ) , org.eclipse.jgit.util.FS.DETECTED ) ; config.load ( ) ; return config ; }

Target:
public static java.io.File defaultFile ( javax.servlet.FilterConfig filterConfig ) { java.lang.String configPath = null ; if ( filterConfig != null ) { configPath = filterConfig.getInitParameter ( com.google.gitiles.GitilesConfig.FILTER_CONFIG_PARAM ) ; } if ( configPath == null ) { configPath = java.lang.System.getProperty ( com.google.gitiles.GitilesConfig.PROPERTY_NAME , com.google.gitiles.GitilesConfig.DEFAULT_PATH ) ; } return new java.io.File ( configPath ) ; }
Source:
private void createLock ( java.lang.String project , com.googlesource.gerrit.plugins.lfs.locks.LfsLocksContext action ) throws java.io.IOException { com.googlesource.gerrit.plugins.lfs.locks.LfsCreateLockInput input = action.input ( com.googlesource.gerrit.plugins.lfs.locks.LfsCreateLockInput.class ) ; com.googlesource.gerrit.plugins.lfs.locks.LfsPutLocksAction.log.debug ( "Create lock for in project {}" , input.path , project ) ; com.googlesource.gerrit.plugins.lfs.locks.LfsLock lock = new com.googlesource.gerrit.plugins.lfs.locks.LfsLock ( "random_id" , input.path , now ( ) , new com.googlesource.gerrit.plugins.lfs.locks.LfsLockOwner ( "Lock Owner <lock_owner@example.com>" ) ) ; action.sendResponse ( lock ) ; }

Target:
public void run ( com.google.gerrit.server.project.ProjectState project , com.google.gerrit.server.CurrentUser user ) throws java.io.IOException , org.eclipse.jgit.lfs.errors.LfsException { com.googlesource.gerrit.plugins.lfs.locks.LfsCreateLockInput input = context.input ( com.googlesource.gerrit.plugins.lfs.locks.LfsCreateLockInput.class ) ; com.googlesource.gerrit.plugins.lfs.locks.LfsPutLocksAction.log.debug ( "Create lock for in project {}" , input.path , project ) ; com.googlesource.gerrit.plugins.lfs.locks.LfsLock lock = new com.googlesource.gerrit.plugins.lfs.locks.LfsLock ( "random_id" , input.path , now ( ) , new com.googlesource.gerrit.plugins.lfs.locks.LfsLockOwner ( "Lock Owner <lock_owner@example.com>" ) ) ; context.sendResponse ( lock ) ; }
Source:
public java.lang.Object createEntry ( final java.lang.Object key ) throws java.lang.Exception { return lookup ( ( ( java.lang.String ) ( key ) ) ) ; }

Target:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < java.lang.String , java.util.Set < com.google.gerrit.client.reviewdb.Account.Id > > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < java.lang.String , java.util.Set < com.google.gerrit.client.reviewdb.Account.Id > > > ( ) { } ; core ( type , com.google.gerrit.server.account.AccountByEmailCache.CACHE_NAME ) ; bind ( com.google.gerrit.server.account.AccountByEmailCache.class ) ; }
Source:
protected void configure ( ) { if ( ( gerritConfig.getString ( JiraItsFacade.ITS_NAME_JIRA , null , "url" ) ) != null ) { com.googlesource.gerrit.plugins.hooks.jira.JiraModule.LOG.info ( "JIRA is configured as ITS" ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) . toInstance ( new com.googlesource.gerrit.plugins.hooks.jira.JiraItsFacade ( gerritConfig ) ) ; install ( new com.googlesource.gerrit.plugins.hooks.ItsHookModule ( JiraItsFacade.ITS_NAME_JIRA ) ) ; } }

Target:
protected void configure ( ) { if ( ( gerritConfig.getString ( pluginName , null , "url" ) ) != null ) { com.googlesource.gerrit.plugins.hooks.jira.JiraModule.LOG.info ( "JIRA is configured as ITS" ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) . toInstance ( new com.googlesource.gerrit.plugins.hooks.jira.JiraItsFacade ( pluginName , gerritConfig ) ) ; install ( new com.googlesource.gerrit.plugins.hooks.ItsHookModule ( ) ) ; } }
Source:
private void initListId ( final java.lang.String messageClass ) throws javax.mail.MessagingException { final java.lang.StringBuilder listid = new java.lang.StringBuilder ( ) ; listid.append ( "gerrit-" ) ; listid.append ( messageClass ) ; listid.append ( "-" ) ; listid.append ( projectName.replace ( '/' , '-' ) ) ; listid.append ( "@" ) ; listid.append ( gerritHost ( ) ) ; final java.lang.String listidStr = listid.toString ( ) ; msg.setHeader ( "Mailing-List" , ( "list " + listidStr ) ) ; msg.setHeader ( "List-Id" , ( ( "<" + ( listidStr.replace ( '@' , '.' ) ) ) + ">" ) ) ; }

Target:
private void initListId ( final java.lang.String messageClass ) throws javax.mail.MessagingException { final java.lang.StringBuilder listid = new java.lang.StringBuilder ( ) ; listid.append ( "gerrit-" ) ; listid.append ( messageClass ) ; listid.append ( "-" ) ; listid.append ( projectName.replace ( '/' , '-' ) ) ; listid.append ( "@" ) ; listid.append ( gerritHost ( ) ) ; final java.lang.String listidStr = listid.toString ( ) ; msg.setHeader ( "Mailing-List" , ( "list " + listidStr ) ) ; msg.setHeader ( "List-Id" , ( ( "<" + ( listidStr.replace ( '@' , '.' ) ) ) + ">" ) ) ; if ( ( settingsUrl ( ) ) != null ) { msg.setHeader ( "List-Unsubscribe" , ( ( "<" + ( settingsUrl ( ) ) ) + ">" ) ) ; } }
Source:
public com.google.common.collect.ImmutableSetMultimap < com.google.gerrit.server.notedb.ReviewerStateInternal , com.google.gerrit.reviewdb.client.Account.Id > getReviewers ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gwtorm.server.OrmException { if ( ! ( migration.readChanges ( ) ) ) { return com.google.gerrit.server.ApprovalsUtil.getReviewers ( db.patchSetApprovals ( ) . byChange ( notes.getChangeId ( ) ) ) ; } return notes.load ( ) . getReviewers ( ) ; }

Target:
public com.google.gerrit.server.ReviewerSet getReviewers ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gwtorm.server.OrmException { if ( ! ( migration.readChanges ( ) ) ) { return com.google.gerrit.server.ReviewerSet.fromApprovals ( db.patchSetApprovals ( ) . byChange ( notes.getChangeId ( ) ) ) ; } return notes.load ( ) . getReviewers ( ) ; }
Source:
public com.google.gerrit.server.project.SubmitRuleEvaluator setPatchSet ( com.google.gerrit.reviewdb.client.PatchSet ps ) { com.google.common.base.Preconditions.checkArgument ( ps.getId ( ) . getParentKey ( ) . equals ( cd.getId ( ) ) ) ; patchSet = ps ; return this ; }

Target:
public com.google.gerrit.server.project.SubmitRuleEvaluator setPatchSet ( com.google.gerrit.reviewdb.client.PatchSet ps ) { com.google.common.base.Preconditions.checkArgument ( ps.getId ( ) . getParentKey ( ) . equals ( cd.getId ( ) ) , "Patch set %s does not match change %s" , ps.getId ( ) , cd.getId ( ) ) ; patchSet = ps ; return this ; }
Source:
public com.google.gerrit.extensions.auth.oauth.OAuthToken get ( java.lang.String userName ) { com.google.gerrit.extensions.auth.oauth.OAuthToken accessToken = cache.getIfPresent ( userName ) ; if ( accessToken == null ) { return null ; } accessToken = decrypt ( accessToken ) ; if ( accessToken.isExpired ( ) ) { cache.invalidate ( userName ) ; return null ; } return accessToken ; }

Target:
public void remove ( com.google.gerrit.reviewdb.client.Account.Id id ) { cache.invalidate ( id ) ; }
Source:
static com.google.gerrit.server.notedb.NotesMigration allEnabled ( ) { org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.setBoolean ( "notedb" , null , "write" , true ) ; cfg.setBoolean ( "notedb" , "patchSetApprovals" , "read" , true ) ; cfg.setBoolean ( "notedb" , "changeMessages" , "read" , true ) ; return new com.google.gerrit.server.notedb.NotesMigration ( cfg ) ; }

Target:
static com.google.gerrit.server.notedb.NotesMigration allEnabled ( ) { org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.setBoolean ( "notedb" , null , "write" , true ) ; cfg.setBoolean ( "notedb" , "patchSetApprovals" , "read" , true ) ; cfg.setBoolean ( "notedb" , "changeMessages" , "read" , true ) ; cfg.setBoolean ( "notedb" , "publishedComments" , "read" , true ) ; return new com.google.gerrit.server.notedb.NotesMigration ( cfg ) ; }
Source:
public void printJson ( final java.lang.StringBuilder sb , final org.eclipse.jgit.diff.Edit o ) { sb.append ( '[' ) ; sb.append ( o.getBeginA ( ) ) ; sb.append ( ',' ) ; sb.append ( o.getEndA ( ) ) ; sb.append ( ',' ) ; sb.append ( o.getBeginB ( ) ) ; sb.append ( ',' ) ; sb.append ( o.getEndB ( ) ) ; sb.append ( ']' ) ; }

Target:
public void printJson ( final java.lang.StringBuilder sb , final org.eclipse.jgit.diff.Edit o ) { sb.append ( '[' ) ; append ( sb , o ) ; if ( o instanceof org.eclipse.jgit.diff.ReplaceEdit ) { for ( org.eclipse.jgit.diff.Edit e : ( ( org.eclipse.jgit.diff.ReplaceEdit ) ( o ) ) . getInternalEdits ( ) ) { sb.append ( ',' ) ; append ( sb , e ) ; } } sb.append ( ']' ) ; }
Source:
public void testUnblockInParentBlockInLocal ( ) { grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertFalse ( "u can't push" , d.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }

Target:
public void testUnblockInParentBlockInLocal ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertFalse ( "u can't push" , d.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }
Source:
com.google.gerrit.extensions.common.CommentInfo format ( com.google.gerrit.reviewdb.client.PatchLineComment c ) throws com.google.gwtorm.server.OrmException { return format ( c , true ) ; }

Target:
com.google.gerrit.extensions.common.CommentInfo format ( com.google.gerrit.reviewdb.client.PatchLineComment c ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.account.AccountLoader loader = null ; if ( fillAccounts ) { loader = accountLoaderFactory.create ( true ) ; } com.google.gerrit.extensions.common.CommentInfo commentInfo = toCommentInfo ( c , loader ) ; if ( fillAccounts ) { loader.fill ( ) ; } return commentInfo ; }
Source:
public static com.google.gerrit.extensions.api.projects.TagInfo createTagInfo ( org.eclipse.jgit.lib.Ref ref , org.eclipse.jgit.revwalk.RevWalk rw , com.google.gerrit.server.project.RefControl control , com.google.gerrit.server.project.ProjectControl pctl , com.google.gerrit.server.WebLinks links ) { }

Target:
private java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > visibleTags ( com.google.gerrit.server.project.ProjectControl pctl , org.eclipse.jgit.lib.Repository repo , java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > tags ) { return refFilterFactory.create ( pctl.getProjectState ( ) , repo ) . setShowMetadata ( false ) . filter ( tags , true ) ; }
Source:
public void initConfig ( com.google.gerrit.pgm.init.api.Section database ) { boolean hasUrl = ( com.google.common.base.Strings.emptyToNull ( database.get ( "url" ) ) ) != null ; database.string ( "URL" , "url" , null ) ; guessDriver ( database ) ; database.string ( "Driver class name" , "driver" , null ) ; database.string ( "Database username" , "username" , ( hasUrl ? null : com.google.gerrit.pgm.init.InitUtil.username ( ) ) ) ; database.password ( "username" , "password" ) ; }

Target:
public void initConfig ( com.google.gerrit.pgm.init.api.Section database ) { boolean hasUrl = ( com.google.common.base.Strings.emptyToNull ( database.get ( "url" ) ) ) != null ; database.string ( "URL" , "url" , null ) ; guessDriver ( database ) ; database.string ( "Driver class name" , "driver" , null ) ; database.string ( "Database username" , "username" , ( hasUrl ? null : com.google.gerrit.pgm.init.api.InitUtil.username ( ) ) ) ; database.password ( "username" , "password" ) ; }
Source:
private static long getFileSize ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.lib.ObjectReader reader , java.lang.String path , org.eclipse.jgit.revwalk.RevTree t ) throws java.io.IOException { try ( org.eclipse.jgit.treewalk.TreeWalk tw = org.eclipse.jgit.treewalk.TreeWalk.forPath ( reader , path , t ) ) { return tw != null ? repo.open ( tw.getObjectId ( 0 ) , org.eclipse.jgit.lib.Constants.OBJ_BLOB ) . getSize ( ) : 0 ; } }

Target:
private static long getFileSize ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.lib.ObjectReader reader , org.eclipse.jgit.lib.FileMode mode , java.lang.String path , org.eclipse.jgit.revwalk.RevTree t ) throws java.io.IOException { if ( ! ( com.google.gerrit.server.patch.PatchListLoader.isBlob ( mode ) ) ) { return 0 ; } try ( org.eclipse.jgit.treewalk.TreeWalk tw = org.eclipse.jgit.treewalk.TreeWalk.forPath ( reader , path , t ) ) { return tw != null ? repo.open ( tw.getObjectId ( 0 ) , org.eclipse.jgit.lib.Constants.OBJ_BLOB ) . getSize ( ) : 0 ; } }
Source:
public void isEnabledForRegexRef ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig config = getConfig ( ( "[plugin \"uploadvalidator\"]\n" + ( " ref = ^refs/heads/mybranch.*\n" + " blockedFileExtension = jar" ) ) ) ; assertThat ( config.isEnabledForRef ( projectName , "refs/heads/anotherref" ) ) . isFalse ( ) ; assertThat ( config.isEnabledForRef ( projectName , "refs/heads/mybranch123" ) ) . isTrue ( ) ; }

Target:
public void isDisabledForInvalidRef ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig config = getConfig ( ( "[plugin \"uploadvalidator\"]\n" + ( " ref = anInvalidRef\n" + " blockedFileExtension = jar" ) ) ) ; com.google.common.truth.Truth.assertThat ( config.isEnabledForRef ( projectName , "refs/heads/anyref" , "blockedFileExtension" ) ) . isFalse ( ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo info ) { running = false ; screen.showUpdates ( info ) ; int d = ( com.google.gerrit.client.ui.UserActivityMonitor.isActive ( ) ) ? com.google.gerrit.client.change.UpdateCheckTimer.POLL_PERIOD : com.google.gerrit.client.change.UpdateCheckTimer.IDLE_PERIOD ; if ( d != ( delay ) ) { delay = d ; schedule ( ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.info.ChangeInfo info ) { running = false ; screen.showUpdates ( info ) ; int d = ( com.google.gerrit.client.ui.UserActivityMonitor.isActive ( ) ) ? com.google.gerrit.client.change.UpdateCheckTimer.POLL_PERIOD : com.google.gerrit.client.change.UpdateCheckTimer.IDLE_PERIOD ; if ( d != ( delay ) ) { delay = d ; schedule ( ) ; } }
Source:
public void setValue ( com.google.gerrit.common.data.AccessSection value ) { this . value = value ; this . readOnly = ! ( projectAccess.isOwnerOf ( value ) ) ; refPattern.setEnabled ( ( ! ( readOnly ) ) ) ; deleteSection.setVisible ( ( ! ( readOnly ) ) ) ; if ( readOnly ) { addContainer.getStyle ( ) . setDisplay ( Display.NONE ) ; } else { enableEditing ( ) ; } }

Target:
public void setValue ( com.google.gerrit.common.data.AccessSection value ) { this . value = value ; this . readOnly = ( ! ( editing ) ) || ( ! ( projectAccess.isOwnerOf ( value ) ) ) ; refPattern.setEnabled ( ( ! ( readOnly ) ) ) ; deleteSection.setVisible ( ( ! ( readOnly ) ) ) ; if ( readOnly ) { addContainer.getStyle ( ) . setDisplay ( Display.NONE ) ; } else { enableEditing ( ) ; } }
Source:
java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > getForPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet ps = db.patchSets ( ) . get ( psId ) ; if ( ps == null ) { return java.util.Collections.emptyList ( ) ; } return getForPatchSet ( db , ctl , ps ) ; }

Target:
java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > getForPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet ps = psUtil.get ( db , ctl.getNotes ( ) , psId ) ; if ( ps == null ) { return java.util.Collections.emptyList ( ) ; } return getForPatchSet ( db , ctl , ps ) ; }
Source:
private boolean isEdit ( ) { return getStyleName ( ) . contains ( draftStyle.edit ( ) ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; messageClick = contentPanelMessage.addDoubleClickHandler ( new com.google.gwt.event.dom.client.DoubleClickHandler ( ) { @ java.lang.Override public void onDoubleClick ( com.google.gwt.event.dom.client.DoubleClickEvent arg0 ) { setEdit ( true ) ; } } ) ; addDomHandler ( new com.google.gwt.event.dom.client.MouseMoveHandler ( ) { @ java.lang.Override public void onMouseMove ( com.google.gwt.event.dom.client.MouseMoveEvent arg0 ) { resizePaddingWidget ( ) ; } } , com.google.gwt.event.dom.client.MouseMoveEvent.getType ( ) ) ; }
Source:
private boolean recursiveDelete ( java.io.File file ) { if ( file.isDirectory ( ) ) { java.io.File [ ] contents = file.listFiles ( ) ; if ( contents == null ) { return false ; } for ( java.io.File f : contents ) { if ( ! ( recursiveDelete ( f ) ) ) { return false ; } } } return file.delete ( ) ; }

Target:
private void recursiveDelete ( java.nio.file.Path file ) throws java.io.IOException { java.nio.file.Files.walkFileTree ( file , new java.nio.file.SimpleFileVisitor < java.nio.file.Path > ( ) { @ java.lang.Override public java.nio.file.FileVisitResult visitFile ( java.nio.file.Path file , java.nio.file.attribute.BasicFileAttributes attrs ) throws java.io.IOException { java.nio.file.Files.delete ( file ) ; return java.nio.file.FileVisitResult.CONTINUE ; } @ java.lang.Override public java.nio.file.FileVisitResult postVisitDirectory ( java.nio.file.Path dir , java.io.IOException e ) throws java.io.IOException { if ( e != null ) { throw e ; } java.nio.file.Files.delete ( dir ) ; return java.nio.file.FileVisitResult.CONTINUE ; } } ) ; }
Source:
public void update ( ) { Util.ACCOUNT_SVC.mySshKeys ( new com.google.gerrit.client.rpc.GerritCallback < java.util.List < com.google.gerrit.client.reviewdb.AccountSshKey > > ( ) { public void onSuccess ( final java.util.List < com.google.gerrit.client.reviewdb.AccountSshKey > result ) { keys.display ( result ) ; keys.finishDisplay ( true ) ; } } ) ; }

Target:
public void update ( ) { Util.ACCOUNT_SEC.mySshKeys ( new com.google.gerrit.client.rpc.GerritCallback < java.util.List < com.google.gerrit.client.reviewdb.AccountSshKey > > ( ) { public void onSuccess ( final java.util.List < com.google.gerrit.client.reviewdb.AccountSshKey > result ) { keys.display ( result ) ; keys.finishDisplay ( true ) ; } } ) ; }
Source:
protected void onOpenRow ( final int row ) { com.google.gerrit.client.groups.GroupInfo groupInfo = getRowItem ( row ) ; if ( isInteralGroup ( groupInfo ) ) { com.google.gwt.user.client.History.newItem ( com.google.gerrit.client.Dispatcher.toGroup ( groupInfo.getGroupId ( ) ) ) ; } else if ( ( groupInfo.url ( ) ) != null ) { com.google.gwt.user.client.Window.open ( groupInfo.url ( ) , "_self" , null ) ; } }

Target:
protected void onOpenRow ( final int row ) { com.google.gerrit.client.info.GroupInfo groupInfo = getRowItem ( row ) ; if ( isInteralGroup ( groupInfo ) ) { com.google.gwt.user.client.History.newItem ( com.google.gerrit.client.Dispatcher.toGroup ( groupInfo.getGroupId ( ) ) ) ; } else if ( ( groupInfo.url ( ) ) != null ) { com.google.gwt.user.client.Window.open ( groupInfo.url ( ) , "_self" , null ) ; } }
Source:
private void assertIsUnhealthy ( ) throws java.io.IOException { javax.servlet.http.HttpServletResponse responseMock = mock ( javax.servlet.http.HttpServletResponse.class ) ; servlet.doGet ( null , responseMock ) ; org.mockito.Mockito.verify ( responseMock ) . sendError ( javax.servlet.http.HttpServletResponse.SC_SERVICE_UNAVAILABLE ) ; }

Target:
public void testTransitionToHealthyByNonAdmins ( ) throws java.io.IOException { servlet.doDelete ( null , org.mockito.Mockito.mock ( javax.servlet.http.HttpServletResponse.class ) ) ; assertIsUnhealthy ( ) ; org.mockito.Mockito.when ( capabilityControlMock.canAdministrateServer ( ) ) . thenReturn ( false ) ; javax.servlet.http.HttpServletResponse responseMock = org.mockito.Mockito.mock ( javax.servlet.http.HttpServletResponse.class ) ; servlet.doPost ( null , responseMock ) ; org.mockito.Mockito.verify ( responseMock ) . sendError ( javax.servlet.http.HttpServletResponse.SC_FORBIDDEN ) ; assertIsUnhealthy ( ) ; }
Source:
private static java.lang.String imgSrc ( java.lang.String val ) { if ( ( ( val.startsWith ( "http:" ) ) || ( val.startsWith ( "https:" ) ) ) && ( com.google.gitiles.doc.html.HtmlBuilder.URI.getValueFilter ( ) . matcher ( val ) . find ( ) ) ) { return com.google.gitiles.doc.html.HtmlBuilder.URI.escape ( val ) ; } if ( com.google.gitiles.doc.html.HtmlBuilder.IMAGE_DATA.getValueFilter ( ) . matcher ( val ) . find ( ) ) { return val ; } return com.google.gitiles.doc.html.HtmlBuilder.IMAGE_DATA.getInnocuousOutput ( ) ; }

Target:
private static java.lang.String imgSrc ( java.lang.String val ) { if ( ( ( val.startsWith ( "http:" ) ) || ( val.startsWith ( "https:" ) ) ) && ( com.google.gitiles.doc.html.HtmlBuilder.URI.getValueFilter ( ) . matcher ( val ) . find ( ) ) ) { return com.google.gitiles.doc.html.HtmlBuilder.URI.escape ( val ) ; } if ( com.google.gitiles.doc.html.HtmlBuilder.isImageDataUri ( val ) ) { return val ; } return com.google.gitiles.doc.html.HtmlBuilder.IMAGE_DATA.getInnocuousOutput ( ) ; }
Source:
public static void publishEdit ( int id , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JavaScriptObject > cb ) { com.google.gwt.core.client.JavaScriptObject in = com.google.gwt.core.client.JavaScriptObject.createObject ( ) ; com.google.gerrit.client.changes.ChangeApi.change ( id ) . view ( "edit:publish" ) . post ( in , cb ) ; }

Target:
public static void move ( java.lang.String project , int id , java.lang.String destination , java.lang.String message , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.MoveInput moveInput = com.google.gerrit.client.changes.ChangeApi.MoveInput.create ( ) ; moveInput.setMessage ( message ) ; moveInput.setDestinationBranch ( destination ) ; com.google.gerrit.client.changes.ChangeApi.change ( project , id ) . view ( "move" ) . post ( moveInput , cb ) ; }
Source:
private short getContext ( ) { final int sel = context.getSelectedIndex ( ) ; if ( 0 <= sel ) { return java.lang.Short.parseShort ( context.getValue ( sel ) ) ; } return ( ( short ) ( value.getContext ( ) ) ) ; }

Target:
private com.google.gerrit.reviewdb.AccountDiffPreference.Whitespace getIgnoreWhitespace ( ) { final int sel = ignoreWhitespace.getSelectedIndex ( ) ; if ( 0 <= sel ) { return com.google.gerrit.reviewdb.AccountDiffPreference.Whitespace.valueOf ( ignoreWhitespace.getValue ( sel ) ) ; } return value.getIgnoreWhitespace ( ) ; }
Source:
public void copyAllScoresIfNoChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result patchSet = readyPatchSetForNoChangeRebase ( ) ; codeReview.setCopyAllScoresIfNoChange ( true ) ; saveLabelConfig ( ) ; rebase ( patchSet ) ; assertApproval ( patchSet , 1 ) ; }

Target:
public void noCopyMinScoreOnRework ( ) throws java.lang.Exception { codeReview.setCopyMinScore ( false ) ; saveLabelConfig ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; revision ( r ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.reject ( ) ) ; assertApproval ( r , ( - 2 ) ) ; r = amendChange ( r.getChangeId ( ) ) ; assertApproval ( r , 0 ) ; }
Source:
public void withValidGroupName ( ) throws java.lang.Exception { java.lang.String newGroupName = "newGroup" ; adminSession.put ( ( "/groups/" + newGroupName ) ) ; java.lang.String newProjectName = "newProject" ; sshSession.exec ( ( ( ( "gerrit create-project --branch master --owner " + newGroupName ) + " " ) + newProjectName ) ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( sshSession.getError ( ) ) . that ( sshSession.hasError ( ) ) . isFalse ( ) ; com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( newProjectName ) ) ; com.google.common.truth.Truth.assertThat ( projectState ) . isNotNull ( ) ; }

Target:
public void withValidGroupName ( ) throws java.lang.Exception { java.lang.String newGroupName = "newGroup" ; adminRestSession.put ( ( "/groups/" + newGroupName ) ) ; java.lang.String newProjectName = "newProject" ; adminSshSession.exec ( ( ( ( "gerrit create-project --branch master --owner " + newGroupName ) + " " ) + newProjectName ) ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( adminSshSession.getError ( ) ) . that ( adminSshSession.hasError ( ) ) . isFalse ( ) ; com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( newProjectName ) ) ; com.google.common.truth.Truth.assertThat ( projectState ) . isNotNull ( ) ; }
Source:
public com.google.gerrit.server.account.CapabilityControl create ( com.google.gerrit.server.CurrentUser user ) { return capabilities ; }

Target:
public com.google.gerrit.server.IdentifiedUser materializedCopy ( ) { com.google.inject.Provider < java.net.SocketAddress > remotePeer ; try { remotePeer = com.google.inject.util.Providers.of ( remotePeerProvider.get ( ) ) ; } catch ( com.google.inject.OutOfScopeException | com.google.inject.ProvisionException e ) { remotePeer = new com.google.inject.Provider < java.net.SocketAddress > ( ) { @ java.lang.Override public java.net.SocketAddress get ( ) { throw e ; } } ; } return new com.google.gerrit.server.IdentifiedUser ( authConfig , realm , anonymousCowardName , com.google.inject.util.Providers.of ( canonicalUrl.get ( ) ) , accountCache , groupBackend , disableReverseDnsLookup , remotePeer , state , realUser ) ; }
Source:
public void patchSetObjectAndRefMissing ( ) throws java.lang.Exception { java.lang.String rev = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = insertMissingPatchSet ( ctl , rev ) ; ctl = reload ( ctl ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Ref missing: " + ( ps.getId ( ) . toRefName ( ) ) ) ) , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Object missing: patch set 2:" + " deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ) ) ; }

Target:
public void patchSetObjectAndRefMissing ( ) throws java.lang.Exception { java.lang.String rev = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = insertMissingPatchSet ( ctl , rev ) ; ctl = reload ( ctl ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Ref missing: " + ( ps.getId ( ) . toRefName ( ) ) ) ) , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( "Object missing: patch set 2: deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ) ; }
Source:
protected < T > void doInvoke ( final java.lang.String methodName , final java.lang.String reqData , final com.google.gwtjsonrpc.client.ResultDeserializer < T > ser , final com.google.gwt.user.client.rpc.AsyncCallback < T > cb ) throws com.google.gwt.user.client.rpc.InvocationException { if ( ( url ) == null ) { throw new com.google.gwtjsonrpc.client.NoServiceEntryPointSpecifiedException ( ) ; } new com.google.gwtjsonrpc.client.JsonCall < T > ( this , methodName , reqData , ser , cb ) . send ( ) ; }

Target:
protected < T > void doInvoke ( final java.lang.String methodName , final java.lang.String reqData , final com.google.gwtjsonrpc.client.ResultDeserializer < T > ser , final com.google.gwt.user.client.rpc.AsyncCallback < T > cb ) throws com.google.gwt.user.client.rpc.InvocationException { if ( ( url ) == null ) { throw new com.google.gwtjsonrpc.client.NoServiceEntryPointSpecifiedException ( ) ; } newJsonCall ( this , methodName , reqData , ser , cb ) . send ( ) ; }
Source:
public void listTagsOfNonVisibleProjectWithApi ( ) throws java.lang.Exception { blockRead ( project , "refs/*" ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; gApi.projects ( ) . name ( project.get ( ) ) . tags ( ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; gApi.projects ( ) . name ( project.get ( ) ) . tag ( "tag" ) . get ( ) ; }

Target:
public void listTagsOfNonVisibleProjectWithApi ( ) throws java.lang.Exception { blockRead ( project , "refs/*" ) ; setApiUser ( user ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; gApi.projects ( ) . name ( project.get ( ) ) . tags ( ) . get ( ) ; }
Source:
public void testInheritRead_SingleBranchDeniesUpload ( ) { inherited.add ( grant ( com.google.gerrit.reviewdb.ApprovalCategory.READ , registered , "refs/*" , 1 , 2 ) ) ; local.add ( grant ( com.google.gerrit.reviewdb.ApprovalCategory.READ , registered , "-refs/heads/foobar" , 1 , 1 ) ) ; com.google.gerrit.server.project.ProjectControl u = user ( ) ; assertTrue ( "can upload" , u.canUploadToAtLeastOneRef ( ) ) ; assertTrue ( "can upload refs/heads/master" , u.controlForRef ( "refs/heads/master" ) . canUpload ( ) ) ; assertFalse ( "deny refs/heads/foobar" , u.controlForRef ( "refs/heads/foobar" ) . canUpload ( ) ) ; }

Target:
public void testInheritRead_SingleBranchDeniesUpload ( ) { inherited.add ( grant ( com.google.gerrit.reviewdb.ApprovalCategory.READ , registered , "refs/*" , 1 , 2 ) ) ; local.add ( grant ( com.google.gerrit.reviewdb.ApprovalCategory.READ , registered , "-refs/heads/foobar" , 1 , 1 ) ) ; com.google.gerrit.server.project.ProjectControl u = user ( ) ; assertTrue ( "can upload" , u.canPushToAtLeastOneRef ( ) ) ; assertTrue ( "can upload refs/heads/master" , u.controlForRef ( "refs/heads/master" ) . canUpload ( ) ) ; assertFalse ( "deny refs/heads/foobar" , u.controlForRef ( "refs/heads/foobar" ) . canUpload ( ) ) ; }
Source:
public void manualCertificationMatchesExternalId ( ) throws java.lang.Exception { addExternalId ( "foo" , "myId" , null ) ; com.google.gerrit.gpg.PublicKeyChecker checker = checkerFactory.create ( ) . setExpectedUser ( user ) . disableTrust ( ) ; assertNoProblems ( checker.check ( com.google.gerrit.gpg.testutil.TestKeys.validKeyWithSecondUserId ( ) . getPublicKey ( ) ) ) ; }

Target:
public void manualCertificationMatchesExternalId ( ) throws java.lang.Exception { addExternalId ( "foo" , "myId" , null ) ; com.google.gerrit.gpg.PublicKeyChecker checker = checkerFactory.create ( user , store ) . disableTrust ( ) ; assertNoProblems ( checker.check ( com.google.gerrit.gpg.testutil.TestKeys.validKeyWithSecondUserId ( ) . getPublicKey ( ) ) ) ; }
Source:
public com.google.gerrit.server.change.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { return new com.google.gerrit.server.change.Description ( ) . setLabel ( "Ready" ) . setTitle ( "Set Ready For Review" ) . setVisible ( ( ( ( rsrc.isUserOwner ( ) ) && ( ( rsrc.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.NEW ) ) ) && ( rsrc.getChange ( ) . isWorkInProgress ( ) ) ) ) ; }

Target:
public com.google.gerrit.server.change.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { return new com.google.gerrit.server.change.Description ( ) . setLabel ( "Start Review" ) . setTitle ( "Set Ready For Review" ) . setVisible ( ( ( ( rsrc.isUserOwner ( ) ) && ( ( rsrc.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.NEW ) ) ) && ( rsrc.getChange ( ) . isWorkInProgress ( ) ) ) ) ; }
Source:
public void start ( ) { if ( ( executor ) != null ) { for ( final com.google.gerrit.server.cache.h2.H2CacheImpl < ? , ? > cache : caches ) { executor.execute ( cache :: start ) ; cleanup.schedule ( ( ) -> cache.prune ( cleanup ) , 30 , java.util.concurrent.TimeUnit.SECONDS ) ; } } }

Target:
public void start ( ) { if ( ( executor ) != null ) { for ( final com.google.gerrit.server.cache.h2.H2CacheImpl < ? , ? > cache : caches ) { executor.execute ( cache :: start ) ; @ java.lang.SuppressWarnings ( value = "unused" ) java.util.concurrent.Future < ? > possiblyIgnoredError = cleanup.schedule ( ( ) -> cache.prune ( cleanup ) , 30 , java.util.concurrent.TimeUnit.SECONDS ) ; } } }
Source:
protected void run ( ) throws com.google.gerrit.sshd.commands.Failure { try { com.google.gerrit.server.group.GroupResource rsrc = groups.parse ( TopLevelResource.INSTANCE , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( groupName ) ) ; com.google.gerrit.server.group.PutName.Input input = new com.google.gerrit.server.group.PutName.Input ( ) ; input.name = newGroupName ; putName.apply ( rsrc , input ) ; } catch ( com.google.gerrit.extensions.restapi.RestApiException | com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw die ( e ) ; } }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.Failure { try { com.google.gerrit.server.group.GroupResource rsrc = groups.parse ( TopLevelResource.INSTANCE , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( groupName ) ) ; com.google.gerrit.extensions.common.NameInput input = new com.google.gerrit.extensions.common.NameInput ( ) ; input.name = newGroupName ; putName.apply ( rsrc , input ) ; } catch ( com.google.gerrit.extensions.restapi.RestApiException | com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw die ( e ) ; } }
Source:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { try { com.google.gerrit.extensions.api.projects.BranchInput in = new com.google.gerrit.extensions.api.projects.BranchInput ( ) ; in.revision = revision ; gApi.projects ( ) . name ( project.getProject ( ) . getNameKey ( ) . get ( ) ) . branch ( name ) . create ( in ) ; } catch ( com.google.gerrit.extensions.restapi.RestApiException e ) { throw new com.google.gerrit.sshd.commands.UnloggedFailure ( 1 , ( "fatal: " + ( e.getMessage ( ) ) ) , e ) ; } }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { try { com.google.gerrit.extensions.api.projects.BranchInput in = new com.google.gerrit.extensions.api.projects.BranchInput ( ) ; in.revision = revision ; gApi.projects ( ) . name ( project.getProject ( ) . getNameKey ( ) . get ( ) ) . branch ( name ) . create ( in ) ; } catch ( com.google.gerrit.extensions.restapi.RestApiException e ) { throw die ( e ) ; } }
Source:
public void create ( ) throws java.lang.Exception { for ( com.google.gerrit.acceptance.rest.project.PushTagIT.TagType tagType : com.google.gerrit.acceptance.rest.project.PushTagIT.TagType.values ( ) ) { pushTagForExistingCommit ( tagType , Status.REJECTED_OTHER_REASON ) ; allowTagCreation ( tagType ) ; pushTagForExistingCommit ( tagType , Status.OK ) ; pushTagForNewCommit ( tagType , Status.REJECTED_OTHER_REASON ) ; } allowPushOnRefsTags ( ) ; for ( com.google.gerrit.acceptance.rest.project.PushTagIT.TagType tagType : com.google.gerrit.acceptance.rest.project.PushTagIT.TagType.values ( ) ) { pushTagForNewCommit ( tagType , Status.OK ) ; } }

Target:
public void createTagForExistingCommit ( ) throws java.lang.Exception { for ( com.google.gerrit.acceptance.rest.project.PushTagIT.TagType tagType : com.google.gerrit.acceptance.rest.project.PushTagIT.TagType.values ( ) ) { pushTagForExistingCommit ( tagType , Status.REJECTED_OTHER_REASON ) ; allowTagCreation ( tagType ) ; pushTagForExistingCommit ( tagType , Status.OK ) ; allowPushOnRefsTags ( ) ; pushTagForExistingCommit ( tagType , Status.OK ) ; removePushFromRefsTags ( ) ; } }
Source:
public com.google.gerrit.extensions.common.EditInfo applyFix ( java.lang.String fixId ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return applyFix.apply ( fixes.parse ( revision , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( fixId ) ) , null ) . value ( ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot apply fix" , e ) ; } }

Target:
public com.google.gerrit.extensions.common.EditInfo applyFix ( java.lang.String fixId ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return applyFix.apply ( fixes.parse ( revision , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( fixId ) ) , null ) . value ( ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot apply fix" , e ) ; } }
Source:
public java.lang.String apply ( com.google.gerrit.reviewdb.client.Account.Id id ) { return java.lang.String.valueOf ( id.get ( ) ) ; }

Target:
private void addMembers ( com.google.gerrit.server.group.GroupResource rsrc ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.group.AddMembers.Input input = AddMembers.Input.fromMembers ( initialMembers.stream ( ) . map ( java.lang.Object :: toString ) . collect ( java.util.stream.Collectors.toList ( ) ) ) ; addMembers.apply ( rsrc , input ) ; }
Source:
private void setMessageText ( java.lang.String message ) { if ( message == null ) { message = "" ; } else { message = message.trim ( ) ; } summary.setInnerText ( com.google.gerrit.client.diff.CommentBox.summarize ( message ) ) ; contentPanelMessage.setInnerText ( message ) ; }

Target:
private void setMessageText ( java.lang.String message ) { if ( message == null ) { message = "" ; } else { message = message.trim ( ) ; } summary.setInnerText ( message ) ; com.google.gwtexpui.safehtml.client.SafeHtml buf = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . append ( message ) . wikify ( ) ; buf = commentLinkProcessor.apply ( buf ) ; com.google.gwtexpui.safehtml.client.SafeHtml.set ( contentPanelMessage , buf ) ; }