auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void asyncStarredChanges ( ) { if ( ( ( starredChanges ) == null ) && ( ( dbProvider ) != null ) ) { try { starredQuery = dbProvider.get ( ) . starredChanges ( ) . byAccount ( getAccountId ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.IdentifiedUser.log.warn ( "Cannot query starred by user changes" , e ) ; starredQuery = null ; starredChanges = java.util.Collections.emptySet ( ) ; } } }

Target:
public void asyncStarredChanges ( ) { if ( ( ( starredChanges ) == null ) && ( ( dbProvider ) != null ) ) { try { starredQuery = starredQuery ( ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.IdentifiedUser.log.warn ( "Cannot query starred by user changes" , e ) ; starredQuery = null ; starredChanges = java.util.Collections.emptySet ( ) ; } } }
Source:
public void owner ( java.lang.String owner ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.group.PutOwner.Input in = new com.google.gerrit.server.group.PutOwner.Input ( ) ; in.owner = owner ; try { putOwner.apply ( rsrc , in ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot put group owner" , e ) ; } }

Target:
public void owner ( java.lang.String owner ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.group.PutOwner.Input in = new com.google.gerrit.server.group.PutOwner.Input ( ) ; in.owner = owner ; try { putOwner.apply ( rsrc , in ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot put group owner" , e ) ; } }
Source:
private com.google.gerrit.server.notedb.ChangeUpdate newUpdate ( com.google.gerrit.reviewdb.client.Change c , com.google.gerrit.server.IdentifiedUser user ) throws java.lang.Exception { return new com.google.gerrit.server.notedb.ChangeUpdate ( com.google.gerrit.server.notedb.ChangeNotesTest.SERVER_IDENT , repoManager , com.google.gerrit.server.notedb.NotesMigration.allEnabled ( ) , accountCache , null , com.google.gerrit.server.notedb.ChangeNotesTest.LABEL_TYPES , stubChangeControl ( c , user ) , com.google.gerrit.server.util.TimeUtil.nowTs ( ) ) ; }

Target:
private com.google.gerrit.server.notedb.ChangeUpdate newUpdate ( com.google.gerrit.reviewdb.client.Change c , final com.google.gerrit.server.IdentifiedUser user ) throws java.lang.Exception { return injector.createChildInjector ( new com.google.gerrit.server.config.FactoryModule ( ) { @ java.lang.Override public void configure ( ) { factory ( ChangeUpdate.Factory.class ) ; bind ( com.google.gerrit.server.IdentifiedUser.class ) . toInstance ( user ) ; } } ) . getInstance ( ChangeUpdate.Factory.class ) . create ( stubChangeControl ( c , user ) , com.google.gerrit.server.util.TimeUtil.nowTs ( ) , com.google.common.collect.Ordering.< java.lang.String > natural ( ) ) ; }
Source:
public java.lang.String rewriteStaticRelativeUrl ( java.lang.String url ) { java.lang.String [ ] urlParts = url.split ( "/" ) ; if ( ( urlParts [ ( ( urlParts.length ) - 1 ) ] . indexOf ( '.' ) ) < 0 ) { return url ; } int depth = ( ( org.apache.wicket.protocol.http.servlet.ServletWebRequest ) ( org.apache.wicket.RequestCycle.get ( ) . getRequest ( ) ) ) . getDepthRelativeToWicketHandler ( ) ; return com.googlesource.gerrit.plugins.gitblit.app.StaticCodingStrategy.getRelativeStaticUrl ( url , depth ) ; }

Target:
public java.lang.String rewriteStaticRelativeUrl ( java.lang.String url ) { java.lang.String [ ] urlParts = url.split ( "/" ) ; if ( ( urlParts [ ( ( urlParts.length ) - 1 ) ] . indexOf ( '.' ) ) < 0 ) { return url ; } if ( isMatchingIgnoreUrlPrefixes ( url ) ) { return url ; } int depth = ( ( org.apache.wicket.protocol.http.servlet.ServletWebRequest ) ( org.apache.wicket.RequestCycle.get ( ) . getRequest ( ) ) ) . getDepthRelativeToWicketHandler ( ) ; return com.googlesource.gerrit.plugins.gitblit.app.StaticCodingStrategy.getRelativeStaticUrl ( url , depth ) ; }
Source:
public void addedFixReplacementCanBeRetrieved ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isTrue ( ) ; addRobotComment ( changeId , withFixRobotCommentInput ) ; java.util.List < com.google.gerrit.extensions.common.RobotCommentInfo > robotCommentInfos = getRobotComments ( ) ; com.google.gerrit.acceptance.api.revision.RobotCommentInfoSubject.assertThatList ( robotCommentInfos ) . onlyElement ( ) . onlyFixSuggestion ( ) . onlyReplacement ( ) . isNotNull ( ) ; }

Target:
public void addedFixReplacementCanBeRetrieved ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isTrue ( ) ; addRobotComment ( changeId , withFixRobotCommentInput ) ; java.util.List < com.google.gerrit.extensions.common.RobotCommentInfo > robotCommentInfos = getRobotComments ( ) ; com.google.gerrit.extensions.common.RobotCommentInfoSubject.assertThatList ( robotCommentInfos ) . onlyElement ( ) . onlyFixSuggestion ( ) . onlyReplacement ( ) . isNotNull ( ) ; }
Source:
private void redirectChooseProvider ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { com.google.gerrit.server.LoginServlet.forceLogout ( rsp ) ; final java.lang.StringBuffer url = req.getRequestURL ( ) ; url.append ( "?" ) ; url.append ( RelyingParty.DEFAULT_PARAMETER ) ; url.append ( "=" ) ; url.append ( org.mortbay.util.UrlEncoded.encodeString ( GoogleAccountDiscovery.GOOGLE_ACCOUNT ) ) ; rsp.sendRedirect ( url.toString ( ) ) ; }

Target:
private void redirectChooseProvider ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { com.google.gerrit.server.LoginServlet.forceLogout ( rsp ) ; final java.lang.StringBuffer url = req.getRequestURL ( ) ; url.append ( "?" ) ; url.append ( RelyingParty.DEFAULT_PARAMETER ) ; url.append ( "=" ) ; url.append ( org.mortbay.util.UrlEncoded.encodeString ( GoogleAccountDiscovery.GOOGLE_ACCOUNT ) ) ; url.append ( "&" ) ; com.google.gerrit.server.LoginServlet.appendCallbackParameter ( req , url ) ; rsp.sendRedirect ( url.toString ( ) ) ; }
Source:
public com.google.gerrit.reviewdb.client.AccountSshKey getKey ( int seq ) { com.google.common.base.Preconditions.checkState ( ( ( keys ) != null ) , "SSH keys not loaded yet" ) ; com.google.common.base.Optional < com.google.gerrit.reviewdb.client.AccountSshKey > key = keys.get ( seq ) ; return key.isPresent ( ) ? key.get ( ) : null ; }

Target:
private boolean deleteKey ( int seq ) { checkLoaded ( ) ; if ( ( seq <= ( keys.size ( ) ) ) && ( keys.get ( ( seq - 1 ) ) . isPresent ( ) ) ) { keys.set ( ( seq - 1 ) , com.google.common.base.Optional.< com.google.gerrit.reviewdb.client.AccountSshKey > absent ( ) ) ; return true ; } return false ; }
Source:
private void fireEvent ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , final com.google.gerrit.server.events.ChangeEvent event ) { for ( com.google.gerrit.common.ChangeHookRunner.ChangeListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( branchName , holder.user ) ) { holder.listener.onChangeEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }

Target:
private void fireEvent ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , final com.google.gerrit.server.events.Event event ) { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( branchName , holder.user ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }
Source:
public void filterOutMoreThanOnePageOfResults ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change = insert ( newChangeForUser ( repo , userId ) ) ; com.google.gerrit.reviewdb.client.Account.Id user2 = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "anotheruser" ) ) . getAccountId ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { insert ( newChangeForUser ( repo , user2 ) ) ; } assertQuery ( "status:new ownerin:Administrators" , change ) ; assertQuery ( "status:new ownerin:Administrators limit:2" , change ) ; }

Target:
public void filterOutMoreThanOnePageOfResults ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change = insert ( repo , newChange ( repo ) , userId ) ; com.google.gerrit.reviewdb.client.Account.Id user2 = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "anotheruser" ) ) . getAccountId ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { insert ( repo , newChange ( repo ) , user2 ) ; } assertQuery ( "status:new ownerin:Administrators" , change ) ; assertQuery ( "status:new ownerin:Administrators limit:2" , change ) ; }
Source:
public void testSortWithRegex ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "^refs/heads/.*" ) ; com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "^refs/heads/.*-QA-.*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertTrue ( "u can read" , u.controlForRef ( "refs/heads/foo-QA-bar" ) . isVisible ( ) ) ; org.junit.Assert.assertTrue ( "d can read" , d.controlForRef ( "refs/heads/foo-QA-bar" ) . isVisible ( ) ) ; }

Target:
public void testSortWithRegex ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "^refs/heads/.*" ) ; com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "^refs/heads/.*-QA-.*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertCanRead ( "refs/heads/foo-QA-bar" , u ) ; assertCanRead ( "refs/heads/foo-QA-bar" , d ) ; }
Source:
public void testUpsertTwoNotExistsing ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchOK ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE ) ; java.sql.PreparedStatement insert = stubExecuteBatchOK ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , 1 , 1 ) ; createClassUnderTest ( ) . upsert ( com.google.gwtorm.jdbc.TestJdbcAccess.TWO_ROWS ) ; verifyIds ( insert , 1 , 2 ) ; }

Target:
public void testUpsertTwoNotExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 0 , 0 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , 1 , 1 ) ; createClassUnderTest ( ) . upsert ( twoRows ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( insert ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertExpectedIdsUsed ( insert , 1 , 2 ) ; }
Source:
private ReviewInput.CommentInput newCommentInfo ( java.lang.String path , com.google.gerrit.extensions.common.Side side , int line , java.lang.String message ) { com.google.gerrit.extensions.api.changes.ReviewInput.CommentInput input = new com.google.gerrit.extensions.api.changes.ReviewInput.CommentInput ( ) ; input.path = path ; input.side = side ; input.line = line ; input.message = message ; return input ; }

Target:
private ReviewInput.CommentInput newCommentInfo ( java.lang.String path , com.google.gerrit.extensions.client.Side side , int line , java.lang.String message ) { com.google.gerrit.extensions.api.changes.ReviewInput.CommentInput input = new com.google.gerrit.extensions.api.changes.ReviewInput.CommentInput ( ) ; input.path = path ; input.side = side ; input.line = ( line != 0 ) ? line : null ; input.message = message ; if ( line != 0 ) { com.google.gerrit.extensions.client.Comment.Range range = new com.google.gerrit.extensions.client.Comment.Range ( ) ; range.startLine = 1 ; range.startCharacter = 1 ; range.endLine = 1 ; range.endCharacter = 5 ; input.range = range ; } return input ; }
Source:
private java.util.List < com.google.gerrit.server.change.GetRelated.ChangeAndCommit > getRelated ( com.google.gerrit.reviewdb.client.Change.Id changeId , int ps ) throws java.lang.Exception { java.lang.String url = java.lang.String.format ( "/changes/%d/revisions/%d/related" , changeId.get ( ) , ps ) ; com.google.gerrit.acceptance.RestResponse r = adminRestSession.get ( url ) ; r.assertOK ( ) ; return newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.change.GetRelated.RelatedInfo.class ) . changes ; }

Target:
private java.util.List < com.google.gerrit.server.restapi.change.GetRelated.ChangeAndCommit > getRelated ( com.google.gerrit.reviewdb.client.Change.Id changeId , int ps ) throws java.lang.Exception { java.lang.String url = java.lang.String.format ( "/changes/%d/revisions/%d/related" , changeId.get ( ) , ps ) ; com.google.gerrit.acceptance.RestResponse r = adminRestSession.get ( url ) ; r.assertOK ( ) ; return newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.restapi.change.GetRelated.RelatedInfo.class ) . changes ; }
Source:
public void batchAbandon ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.server.CurrentUser user , java.util.Collection < com.google.gerrit.server.project.ChangeControl > controls , java.lang.String msgTxt ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.update.UpdateException { batchAbandon ( project , user , controls , msgTxt , NotifyHandling.ALL , com.google.common.collect.ImmutableListMultimap.of ( ) ) ; }

Target:
public void batchAbandon ( com.google.gerrit.server.update.BatchUpdate.Factory updateFactory , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.server.CurrentUser user , java.util.Collection < com.google.gerrit.server.project.ChangeControl > controls , java.lang.String msgTxt ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.update.UpdateException { batchAbandon ( updateFactory , project , user , controls , msgTxt , NotifyHandling.ALL , com.google.common.collect.ImmutableListMultimap.of ( ) ) ; }
Source:
public void fire ( com.google.gerrit.reviewdb.client.Project.NameKey project , org.eclipse.jgit.transport.ReceiveCommand cmd , com.google.gerrit.reviewdb.client.Account updater ) { fire ( project , cmd.getRefName ( ) , cmd.getOldId ( ) , cmd.getNewId ( ) , cmd.getType ( ) , util.accountInfo ( updater ) ) ; }

Target:
public void fire ( com.google.gerrit.reviewdb.client.Project.NameKey project , org.eclipse.jgit.transport.ReceiveCommand cmd , com.google.gerrit.server.account.AccountState updater ) { fire ( project , cmd.getRefName ( ) , cmd.getOldId ( ) , cmd.getNewId ( ) , cmd.getType ( ) , util.accountInfo ( updater ) ) ; }
Source:
private void assertGetComment ( com.google.gerrit.server.change.RevisionResource res , com.google.gerrit.reviewdb.client.PatchLineComment expected , java.lang.String uuid ) throws java.lang.Exception { try { com.google.gerrit.server.change.CommentResource commentRes = comments.parse ( res , com.google.gerrit.extensions.restapi.IdString.fromUrl ( uuid ) ) ; if ( expected == null ) { org.junit.Assert.fail ( "Expected no comment" ) ; } com.google.gerrit.extensions.common.CommentInfo actual = getComment.apply ( commentRes ) ; com.google.gerrit.server.change.CommentsTest.assertComment ( expected , actual , true ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceNotFoundException e ) { if ( expected != null ) { org.junit.Assert.fail ( "Expected to find comment" ) ; } } }

Target:
public void testGetCommentExisting ( ) throws java.lang.Exception { java.lang.String uuid = plc1.getKey ( ) . get ( ) ; com.google.gerrit.server.change.CommentResource commentRes = comments.parse ( revRes1 , com.google.gerrit.extensions.restapi.IdString.fromUrl ( uuid ) ) ; com.google.gerrit.extensions.common.CommentInfo actual = getComment.apply ( commentRes ) ; com.google.gerrit.server.change.CommentsTest.assertComment ( plc1 , actual , true ) ; }
Source:
public void customConflictMessageWithConflictSubstitutionTest ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.automerger.FailedMergeException fme = new com.googlesource.gerrit.plugins.automerger.FailedMergeException ( failedMergeBranches , currentRevision , hostName , "${branch}: ${conflict}" , topic ) ; java.lang.String branch1String = "branch1: branch1 merge conflict" ; java.lang.String branch2String = "branch2: branch2 merge conflict" ; java.lang.String branch3String = "branch3: branch3 merge conflict" ; com.google.common.truth.Truth.assertThat ( fme.getDisplayString ( ) . split ( "\\n" ) ) . asList ( ) . containsExactly ( branch1String , branch2String , branch3String ) ; }

Target:
public void customConflictMessageWithRevisionSubstitutionTest ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.automerger.FailedMergeException fme = new com.googlesource.gerrit.plugins.automerger.FailedMergeException ( failedMergeBranches , currentRevision , hostName , projectName , changeNumber , patchsetNumber , "${branch} ${revision}" , topic ) ; java.lang.String branch1String = "branch1 " + ( currentRevision ) ; java.lang.String branch2String = "branch2 " + ( currentRevision ) ; java.lang.String branch3String = "branch3 " + ( currentRevision ) ; com.google.common.truth.Truth.assertThat ( fme.getDisplayString ( ) . split ( "\\n" ) ) . asList ( ) . containsExactly ( branch1String , branch2String , branch3String ) ; }
Source:
private com.google.gerrit.server.config.GetServerInfo.GitWebInfo getGitWebInfo ( com.google.gerrit.server.config.GitWebConfig cfg ) { if ( ( ( cfg.getUrl ( ) ) == null ) || ( ( cfg.getGitWebType ( ) ) == null ) ) { return null ; } com.google.gerrit.server.config.GetServerInfo.GitWebInfo info = new com.google.gerrit.server.config.GetServerInfo.GitWebInfo ( ) ; info.url = cfg.getUrl ( ) ; info.type = cfg.getGitWebType ( ) ; return info ; }

Target:
private com.google.gerrit.server.config.GetServerInfo.GitwebInfo getGitwebInfo ( com.google.gerrit.server.config.GitwebConfig cfg ) { if ( ( ( cfg.getUrl ( ) ) == null ) || ( ( cfg.getGitwebType ( ) ) == null ) ) { return null ; } com.google.gerrit.server.config.GetServerInfo.GitwebInfo info = new com.google.gerrit.server.config.GetServerInfo.GitwebInfo ( ) ; info.url = cfg.getUrl ( ) ; info.type = cfg.getGitwebType ( ) ; return info ; }
Source:
protected void bccWatchesNotifyAllComments ( ) { if ( ( db ) != null ) { try { final com.google.gerrit.server.project.ProjectState ps = getProjectState ( ) ; if ( ps != null ) { for ( final com.google.gerrit.reviewdb.AccountProjectWatch w : db.accountProjectWatches ( ) . notifyAllComments ( ps.getProject ( ) . getNameKey ( ) ) ) { add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } } catch ( com.google.gwtorm.client.OrmException err ) { } } }

Target:
protected void bccWatchesNotifyAllComments ( ) { if ( ( db ) != null ) { try { final com.google.gerrit.server.project.ProjectState ps = getProjectState ( ) ; if ( ps != null ) { for ( final com.google.gerrit.reviewdb.AccountProjectWatch w : getProjectWatches ( ) ) { if ( w.isNotifyAllComments ( ) ) { add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } } } catch ( com.google.gwtorm.client.OrmException err ) { } } }
Source:
public void onSuccess ( final com.google.gerrit.common.data.HostPageData result ) { com.google.gwt.dom.client.Document.get ( ) . getElementById ( "gerrit_hostpagedata" ) . removeFromParent ( ) ; com.google.gerrit.client.Gerrit.myConfig = result.config ; com.google.gerrit.client.Gerrit.myTheme = result.theme ; com.google.gerrit.client.Gerrit.isNoteDbEnabled = result.isNoteDbEnabled ; if ( ( result.account ) != null ) { com.google.gerrit.client.Gerrit.myAccount = result.account ; com.google.gerrit.client.Gerrit.xGerritAuth = result.xGerritAuth ; } if ( ( result.accountDiffPref ) != null ) { com.google.gerrit.client.Gerrit.myAccountDiffPref = result.accountDiffPref ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; } onModuleLoad2 ( result ) ; }

Target:
public static void setUserPreferences ( com.google.gerrit.client.info.AccountPreferencesInfo prefs ) { com.google.gerrit.client.Gerrit.myPrefs = prefs ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; }
Source:
public static < V > com.google.common.collect.ImmutableList < java.lang.Integer > getWithoutLatest ( com.google.gerrit.index.SchemaDefinitions < V > schemaDef ) { java.util.List < java.lang.Integer > schemaVersions = new java.util.ArrayList ( com.google.gerrit.testutil.IndexVersions.get ( schemaDef ) ) ; schemaVersions.remove ( java.lang.Integer.valueOf ( schemaDef.getLatest ( ) . getVersion ( ) ) ) ; return com.google.common.collect.ImmutableList.copyOf ( schemaVersions ) ; }

Target:
public static < V > com.google.common.collect.ImmutableList < java.lang.Integer > getWithoutLatest ( com.google.gerrit.index.SchemaDefinitions < V > schemaDef ) { java.util.List < java.lang.Integer > schemaVersions = new java.util.ArrayList ( com.google.gerrit.testing.IndexVersions.get ( schemaDef ) ) ; schemaVersions.remove ( java.lang.Integer.valueOf ( schemaDef.getLatest ( ) . getVersion ( ) ) ) ; return com.google.common.collect.ImmutableList.copyOf ( schemaVersions ) ; }
Source:
private void applyAllFailed ( ) { if ( ( ( failed ) && ( finalAdded ) ) && ( remaining.isEmpty ( ) ) ) { for ( com.google.gerrit.client.rpc.CallbackGroup.CallbackImpl < ? > cb : callbacks ) { cb.applyFailed ( ) ; } callbacks.clear ( ) ; } }

Target:
private void apply ( ) { if ( ( finalAdded ) && ( remaining.isEmpty ( ) ) ) { if ( failed ) { for ( com.google.gerrit.client.rpc.CallbackGroup.CallbackGlue cb : callbacks ) { cb.applyFailed ( ) ; } } else { for ( com.google.gerrit.client.rpc.CallbackGroup.CallbackGlue cb : callbacks ) { cb.applySuccess ( ) ; } } callbacks.clear ( ) ; } }
Source:
private void initParent ( ) { parentPanel = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; parentPanel.add ( new com.google.gerrit.client.ui.SmallHeading ( Util.C.headingParentProjectName ( ) ) ) ; parentName = new com.google.gerrit.client.ui.Hyperlink ( "" , "" ) ; parentPanel.add ( parentName ) ; add ( parentPanel ) ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { rights.showInherited ( show.isChecked ( ) ) ; }
Source:
public static java.lang.Iterable < com.google.gerrit.server.plugins.JarScanner.ExtensionMetaData > scan ( java.io.File file , java.lang.String pluginName , java.lang.Class < ? extends java.lang.annotation.Annotation > annotation ) throws com.google.gerrit.server.plugins.InvalidPluginException , java.io.IOException { java.util.Map < java.lang.Class < ? extends java.lang.annotation.Annotation > , java.lang.Iterable < com.google.gerrit.server.plugins.JarScanner.ExtensionMetaData > > result = com.google.gerrit.server.plugins.JarScanner.scan ( new java.util.jar.JarFile ( file ) , pluginName , java.util.Arrays.< java.lang.Class < ? extends java.lang.annotation.Annotation > > asList ( annotation ) ) ; return result.get ( annotation ) ; }

Target:
public java.lang.String transformEntry ( java.lang.Object key , java.lang.Object value ) { return ( ( java.lang.String ) ( value ) ) ; }
Source:
public static void dropTableIfExists ( java.lang.String url ) throws com.google.gwtorm.server.OrmException { try ( java.sql.Connection con = java.sql.DriverManager.getConnection ( url ) ; java.sql.Statement stmt = con.createStatement ( ) ) { stmt.executeUpdate ( "DROP TABLE IF EXISTS ACCOUNT_PATCH_REVIEWS" ) ; } catch ( java.sql.SQLException e ) { throw com.google.gerrit.server.schema.H2AccountPatchReviewStore.convertError ( "create" , e ) ; } }

Target:
public static void dropTableIfExists ( java.lang.String url ) throws com.google.gwtorm.server.OrmException { try ( java.sql.Connection con = java.sql.DriverManager.getConnection ( url ) ; java.sql.Statement stmt = con.createStatement ( ) ) { stmt.executeUpdate ( "DROP TABLE IF EXISTS account_patch_reviews" ) ; } catch ( java.sql.SQLException e ) { throw com.google.gerrit.server.schema.H2AccountPatchReviewStore.convertError ( "create" , e ) ; } }
Source:
private void activate ( final com.google.gerrit.reviewdb.PatchSet.Id patchSetId ) { if ( ! ( patchSetId.equals ( activePatchSetId ) ) ) { deactivate ( ) ; com.google.gerrit.client.changes.PatchSetComplexDisclosurePanel patchSetPanel = patchSetPanels.get ( patchSetId ) ; patchSetPanel.setOpen ( true ) ; patchSetPanel.setActive ( true ) ; activePatchSetId = patchSetId ; } }

Target:
public void activate ( final com.google.gerrit.reviewdb.PatchSet.Id patchSetId ) { if ( ( indexOf ( patchSetId ) ) != ( - 1 ) ) { if ( ! ( patchSetId.equals ( activePatchSetId ) ) ) { deactivate ( ) ; com.google.gerrit.client.changes.PatchSetComplexDisclosurePanel patchSetPanel = patchSetPanels.get ( patchSetId ) ; patchSetPanel.setOpen ( true ) ; patchSetPanel.setActive ( true ) ; activePatchSetId = patchSetId ; } } else { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( patchSetId.getParentKey ( ) ) ) ; } }
Source:
public void setUp ( ) throws java.io.IOException { easyMock = new org.easymock.EasyMockSupport ( ) ; }

Target:
public void setUp ( ) throws java.io.IOException { easyMock = new org.easymock.EasyMockSupport ( ) ; site = new com.google.gerrit.server.config.SitePaths ( gerrit_site.getRoot ( ) . toPath ( ) ) ; java.nio.file.Files.createDirectories ( site.etc_dir ) ; defaultLocalStorePath = ( site.site_path.toString ( ) ) + "/events-db/" ; configMock = easyMock.createMock ( com.google.gerrit.server.config.PluginConfig.class ) ; cfgFactoryMock = easyMock.createMock ( com.google.gerrit.server.config.PluginConfigFactory.class ) ; org.easymock.EasyMock.expect ( cfgFactoryMock.getFromGerritConfig ( org.easymock.EasyMock.anyString ( ) , org.easymock.EasyMock.anyBoolean ( ) ) ) . andStubReturn ( configMock ) ; }
Source:
public void deleteEmail ( java.lang.String email ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.account.AccountResource.Email rsrc = new com.google.gerrit.server.account.AccountResource.Email ( account.getUser ( ) , email ) ; try { deleteEmail.apply ( rsrc , null ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException | com.google.gerrit.server.permissions.PermissionBackendException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot delete email" , e ) ; } }

Target:
public void deleteEmail ( java.lang.String email ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.account.AccountResource.Email rsrc = new com.google.gerrit.server.account.AccountResource.Email ( account.getUser ( ) , email ) ; try { deleteEmail.apply ( rsrc , null ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot delete email" , e ) ; } }
Source:
private java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.change.ReviewerResource rsrc ) throws com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.Account.Id user = rsrc.getReviewerUser ( ) . getAccountId ( ) ; return com.google.common.collect.Iterables.filter ( approvalsUtil.byChange ( db , rsrc.getNotes ( ) ) . values ( ) , new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSetApproval > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.PatchSetApproval input ) { return user.equals ( input.getAccountId ( ) ) ; } } ) ; }

Target:
private java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.change.ReviewerResource rsrc ) throws com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.Account.Id user = rsrc.getReviewerUser ( ) . getAccountId ( ) ; return com.google.common.collect.Iterables.filter ( approvalsUtil.byChange ( db , rsrc.getChangeResource ( ) . getNotes ( ) ) . values ( ) , new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSetApproval > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.PatchSetApproval input ) { return user.equals ( input.getAccountId ( ) ) ; } } ) ; }
Source:
private void insertEmptyLines ( net.codemirror.lib.CodeMirror cm , int nextLine , int cnt ) { addPaddingWidget ( cm , DiffTable.style.padding ( ) , ( nextLine - 1 ) , ( 1.1 * cnt ) , Unit.EM , null ) ; }

Target:
private void addDiffChunkAndPadding ( net.codemirror.lib.CodeMirror cmToPad , int lineToPad , int lineOnOther , int chunkSize ) { net.codemirror.lib.CodeMirror otherCm = otherCm ( cmToPad ) ; linePaddingOnOtherSideMap.put ( otherCm.getLineHandle ( lineOnOther ) , new com.google.gerrit.client.diff.PaddingManager.LinePaddingWidgetWrapper ( addPaddingWidget ( cmToPad , DiffTable.style.padding ( ) , lineToPad , 0 , Unit.EM , null ) , lineToPad , chunkSize ) ) ; diffChunks.add ( new com.google.gerrit.client.diff.SideBySide2.DiffChunkInfo ( getSideFromCm ( otherCm ) , ( ( lineOnOther - chunkSize ) + 1 ) , lineOnOther ) ) ; }
Source:
protected PushOneCommit.Result createChange ( org.eclipse.jgit.api.Git git ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , git ) ; return push.to ( "refs/for/master" ) ; }

Target:
protected PushOneCommit.Result createChange ( java.lang.String subject , java.lang.String fileName , java.lang.String content ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo , subject , fileName , content ) ; return push.to ( "refs/for/master" ) ; }
Source:
private void parseAll ( ) throws java.io.IOException , java.text.ParseException , org.eclipse.jgit.errors.ConfigInvalidException { walk.markStart ( walk.parseCommit ( tip ) ) ; for ( org.eclipse.jgit.revwalk.RevCommit commit : walk ) { parse ( commit ) ; } parseComments ( ) ; pruneReviewers ( ) ; }

Target:
private void parseAll ( ) throws java.io.IOException , java.text.ParseException , org.eclipse.jgit.errors.ConfigInvalidException { walk.markStart ( walk.parseCommit ( tip ) ) ; for ( org.eclipse.jgit.revwalk.RevCommit commit : walk ) { parse ( commit ) ; } parseComments ( ) ; allPastReviewers.addAll ( reviewers.keySet ( ) ) ; pruneReviewers ( ) ; }
Source:
public void testUpsertTwoNotExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 0 , 0 ) ; 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 upsertTwoNotExistingNoInfo ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE , 0 , 0 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.INSERT , 1 , 1 ) ; classUnderTest.upsert ( twoRows ) ; assertCorrectUpdating ( update , 1 , 2 ) ; assertCorrectUpdating ( insert , 1 , 2 ) ; }
Source:
public void onSuccess ( final com.google.gerrit.client.projects.ProjectMap result ) { if ( ( ( mySubname == null ) && ( ( subname ) == null ) ) || ( ( mySubname != null ) && ( mySubname.equals ( subname ) ) ) ) { display ( result ) ; } }

Target:
protected void populateProjects ( ) { com.google.gerrit.client.projects.ProjectMap.match ( subname , new com.google.gerrit.client.ui.IgnoreOutdatedFilterResultsCallbackWrapper < com.google.gerrit.client.projects.ProjectMap > ( this , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.projects.ProjectMap > ( ) { @ java.lang.Override public void onSuccess ( final com.google.gerrit.client.projects.ProjectMap result ) { projectsTab.display ( result , subname ) ; if ( firstPopupLoad ) { firstPopupLoad = false ; displayPopup ( ) ; } } } ) ) ; }
Source:
public boolean apply ( com.google.gerrit.testutil.FakeEmailSender.Message in ) { return ( in.body ( ) . contains ( idFooter ) ) && ( in.body ( ) . contains ( typeFooter ) ) ; }

Target:
public java.util.List < com.google.gerrit.testutil.FakeEmailSender.Message > getMessages ( java.lang.String changeId , java.lang.String type ) { final java.lang.String idFooter = ( "\nGerrit-Change-Id: " + changeId ) + "\n" ; final java.lang.String typeFooter = ( "\nGerrit-MessageType: " + type ) + "\n" ; return getMessages ( ) . stream ( ) . filter ( ( in ) -> ( in.body ( ) . contains ( idFooter ) ) && ( in.body ( ) . contains ( typeFooter ) ) ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }
Source:
public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > load ( java.lang.String key ) throws java.lang.Exception { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > ids = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.AccountGroupById agi : db.accountGroupById ( ) . all ( ) ) { if ( ! ( com.google.gerrit.reviewdb.client.AccountGroup.isInternalGroup ( agi.getIncludeUUID ( ) ) ) ) { ids.add ( agi.getIncludeUUID ( ) ) ; } } return com.google.common.collect.ImmutableSet.copyOf ( ids ) ; } }

Target:
public com.google.common.collect.ImmutableList < com.google.gerrit.reviewdb.client.AccountGroup.UUID > load ( java.lang.String key ) throws java.lang.Exception { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > ids = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.AccountGroupById agi : db.accountGroupById ( ) . all ( ) ) { if ( ! ( com.google.gerrit.reviewdb.client.AccountGroup.isInternalGroup ( agi.getIncludeUUID ( ) ) ) ) { ids.add ( agi.getIncludeUUID ( ) ) ; } } return com.google.common.collect.ImmutableList.copyOf ( ids ) ; } }
Source:
private boolean canRebase ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . canSubmit ( isOwner ( ) ) ) ) || ( getRefControl ( ) . canRebase ( ) ) ) && ( getRefControl ( ) . canUpload ( ) ) ) && ( ! ( isPatchSetLocked ( db ) ) ) ; }

Target:
private boolean canRebase ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . canSubmit ( isOwner ( ) ) ) ) || ( getRefControl ( ) . canRebase ( ) ) ) && ( refControl.asForRef ( ) . testOrFalse ( RefPermission.CREATE_CHANGE ) ) ) && ( ! ( isPatchSetLocked ( db ) ) ) ; }
Source:
private void loadMyEmails ( ) throws com.google.gerrit.server.ssh.Failure { try { for ( final com.google.gerrit.client.reviewdb.AccountExternalId id : db.accountExternalIds ( ) . byAccount ( userAccount.getId ( ) ) ) { if ( ( ( id.getEmailAddress ( ) ) != null ) && ( ( id.getEmailAddress ( ) . length ( ) ) > 0 ) ) { myEmails.add ( id.getEmailAddress ( ) ) ; } } } catch ( com.google.gwtorm.client.OrmException e ) { throw new com.google.gerrit.server.ssh.Failure ( 1 , "fatal: database error" , e ) ; } }

Target:
private void loadMyEmails ( ) throws com.google.gerrit.server.ssh.Failure { addEmail ( userAccount.getPreferredEmail ( ) ) ; try { for ( final com.google.gerrit.client.reviewdb.AccountExternalId id : db.accountExternalIds ( ) . byAccount ( userAccount.getId ( ) ) ) { addEmail ( id.getEmailAddress ( ) ) ; } } catch ( com.google.gwtorm.client.OrmException e ) { throw new com.google.gerrit.server.ssh.Failure ( 1 , "fatal: database error" , e ) ; } }
Source:
private void fireEvent ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.common.Event event , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( change , holder.user , db ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }

Target:
public void postEvent ( com.google.gerrit.common.Event event , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { fireEvent ( event , db ) ; }
Source:
public java.util.List < com.google.gerrit.extensions.common.SshKeyInfo > apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException , org.eclipse.jgit.errors.RepositoryNotFoundException { if ( ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) && ( ! ( self.get ( ) . getCapabilities ( ) . canModifyAccount ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "not allowed to get SSH keys" ) ; } return apply ( rsrc.getUser ( ) ) ; }

Target:
public java.util.List < com.google.gerrit.extensions.common.SshKeyInfo > apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException , org.eclipse.jgit.errors.RepositoryNotFoundException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { permissionBackend.user ( self ) . check ( GlobalPermission.MODIFY_ACCOUNT ) ; } return apply ( rsrc.getUser ( ) ) ; }
Source:
public void initConfig ( com.google.gerrit.pgm.init.Section databaseSection ) { final java.lang.String defPort = "1521" ; databaseSection.string ( "Server hostname" , "hostname" , "localhost" ) ; databaseSection.string ( "Server port" , "port" , defPort , false ) ; databaseSection.string ( "Instance name" , "instance" , "xe" ) ; databaseSection.string ( "Database username" , "username" , com.google.gerrit.pgm.init.InitUtil.username ( ) ) ; databaseSection.password ( "username" , "password" ) ; }

Target:
public void initConfig ( com.google.gerrit.pgm.init.api.Section databaseSection ) { final java.lang.String defPort = "1521" ; databaseSection.string ( "Server hostname" , "hostname" , "localhost" ) ; databaseSection.string ( "Server port" , "port" , defPort , false ) ; databaseSection.string ( "Instance name" , "instance" , "xe" ) ; databaseSection.string ( "Database username" , "username" , com.google.gerrit.pgm.init.InitUtil.username ( ) ) ; databaseSection.password ( "username" , "password" ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.PublishDraftPatchSet.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.update.UpdateException { return publish.apply ( rsrc.getControl ( ) . getUser ( ) , rsrc.getChange ( ) , rsrc.getChange ( ) . currentPatchSetId ( ) , null ) ; }

Target:
protected com.google.gerrit.extensions.restapi.Response < ? > applyImpl ( com.google.gerrit.server.update.BatchUpdate.Factory updateFactory , com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.PublishDraftPatchSet.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.update.UpdateException { return publish.apply ( rsrc.getControl ( ) . getUser ( ) , rsrc.getChange ( ) , rsrc.getChange ( ) . currentPatchSetId ( ) , null ) ; }
Source:
private void createErrorBox ( ) { errorLine = new com.google.gwt.user.client.ui.FlowPanel ( ) ; com.google.gwt.user.client.DOM.setStyleAttribute ( errorLine.getElement ( ) , "visibility" , "hidden" ) ; errorLine.setStyleName ( "gerrit-OpenID-errorline" ) ; errorMsg = new com.google.gwt.user.client.ui.InlineLabel ( ) ; errorLine.add ( errorMsg ) ; formBody.add ( errorLine ) ; }

Target:
private void createErrorBox ( ) { errorLine = new com.google.gwt.user.client.ui.FlowPanel ( ) ; com.google.gwt.user.client.DOM.setStyleAttribute ( errorLine.getElement ( ) , "visibility" , "hidden" ) ; errorLine.setStyleName ( OpenIdResources.I.css ( ) . error ( ) ) ; errorMsg = new com.google.gwt.user.client.ui.InlineLabel ( ) ; errorLine.add ( errorMsg ) ; formBody.add ( errorLine ) ; }
Source:
private com.google.gerrit.server.project.ProjectControl user ( com.google.gerrit.reviewdb.AccountGroup ... memberOf ) { return new com.google.gerrit.server.project.ProjectControl ( new com.google.gerrit.server.project.RefControlTest.MockUser ( memberOf ) , newProjectState ( ) ) ; }

Target:
private com.google.gerrit.server.project.ProjectControl user ( com.google.gerrit.reviewdb.AccountGroup ... memberOf ) { return new com.google.gerrit.server.project.ProjectControl ( java.util.Collections.< com.google.gerrit.reviewdb.AccountGroup.Id > emptySet ( ) , java.util.Collections.< com.google.gerrit.reviewdb.AccountGroup.Id > emptySet ( ) , new com.google.gerrit.server.project.RefControlTest.MockUser ( memberOf ) , newProjectState ( ) ) ; }
Source:
public java.lang.Iterable < com.google.gerrit.reviewdb.client.ChangeMessage > byPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { if ( ! ( migration.readChanges ( ) ) ) { return db.changeMessages ( ) . byPatchSet ( psId ) ; } return notes.load ( ) . getChangeMessages ( ) . get ( psId ) ; }

Target:
public java.lang.Iterable < com.google.gerrit.reviewdb.client.ChangeMessage > byPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { if ( ! ( migration.readChanges ( ) ) ) { return db.changeMessages ( ) . byPatchSet ( psId ) ; } return notes.load ( ) . getChangeMessagesByPatchSet ( ) . get ( psId ) ; }
Source:
protected com.google.gerrit.common.data.PermissionRule block ( java.lang.String permission , com.google.gerrit.reviewdb.client.AccountGroup.UUID id , java.lang.String ref ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.common.data.PermissionRule rule = com.google.gerrit.server.project.Util.block ( cfg , permission , id , ref ) ; saveProjectConfig ( project , cfg ) ; return rule ; }

Target:
protected PushOneCommit.Result amendChange ( java.lang.String changeId , java.lang.String ref ) throws java.lang.Exception { return amendChange ( changeId , ref , admin , testRepo ) ; }
Source:
private boolean canForceUpdate ( ) { if ( canPushWithForce ( ) ) { return true ; } switch ( getUser ( ) . getAccessPath ( ) ) { case GIT : return false ; case JSON_RPC : case REST_API : case SSH_COMMAND : case UNKNOWN : case WEB_BROWSER : default : return ( ( isOwner ( ) ) && ( ! ( isForceBlocked ( Permission.PUSH ) ) ) ) || ( projectControl.isAdmin ( ) ) ; } }

Target:
private boolean canForceUpdate ( ) { if ( canPushWithForce ( ) ) { return true ; } switch ( getUser ( ) . getAccessPath ( ) ) { case GIT : return false ; case JSON_RPC : case REST_API : case SSH_COMMAND : case UNKNOWN : case WEB_BROWSER : default : return ( ( isOwner ( ) ) && ( ! ( isBlocked ( Permission.PUSH , false , true ) ) ) ) || ( projectControl.isAdmin ( ) ) ; } }
Source:
private static void initVimKeys ( ) { net.codemirror.lib.KeyMap km = net.codemirror.lib.CodeMirror.cloneKeyMap ( "vim" ) ; for ( java.lang.String s : new java.lang.String [ ] { "A" , "C" , "J" , "K" , "O" , "R" , "U" , "Ctrl-C" } ) { km.remove ( s ) ; } net.codemirror.lib.CodeMirror.addKeyMap ( "vim_ro" , km ) ; }

Target:
private static void initVimKeys ( ) { net.codemirror.lib.KeyMap km = net.codemirror.lib.CodeMirror.cloneKeyMap ( "vim" ) ; for ( java.lang.String s : new java.lang.String [ ] { "A" , "C" , "O" , "R" , "U" , "Ctrl-C" } ) { km.remove ( s ) ; } net.codemirror.lib.CodeMirror.addKeyMap ( "vim_ro" , km ) ; net.codemirror.lib.CodeMirror.mapVimKey ( "j" , "gj" ) ; net.codemirror.lib.CodeMirror.mapVimKey ( "k" , "gk" ) ; net.codemirror.lib.CodeMirror.mapVimKey ( "Down" , "gj" ) ; net.codemirror.lib.CodeMirror.mapVimKey ( "Up" , "gk" ) ; }
Source:
protected void configure ( ) { com.google.gerrit.sshd.CommandName gerrit = com.google.gerrit.sshd.Commands.named ( "gerrit" ) ; com.google.gerrit.sshd.CommandName index = com.google.gerrit.sshd.Commands.named ( gerrit , "index" ) ; command ( index ) . toProvider ( new com.google.gerrit.sshd.DispatchCommandProvider ( index ) ) ; command ( index , com.google.gerrit.sshd.commands.IndexActivateCommand.class ) ; command ( index , com.google.gerrit.sshd.commands.IndexStartCommand.class ) ; command ( index , com.google.gerrit.sshd.commands.IndexChangesCommand.class ) ; command ( index , com.google.gerrit.sshd.commands.IndexProjectCommand.class ) ; }

Target:
protected void configure ( ) { com.google.gerrit.sshd.CommandName gerrit = com.google.gerrit.sshd.Commands.named ( "gerrit" ) ; com.google.gerrit.sshd.CommandName index = com.google.gerrit.sshd.Commands.named ( gerrit , "index" ) ; command ( index ) . toProvider ( new com.google.gerrit.sshd.DispatchCommandProvider ( index ) ) ; if ( ( injector.getExistingBinding ( com.google.inject.Key.get ( com.google.gerrit.server.index.VersionManager.class ) ) ) != null ) { command ( index , com.google.gerrit.sshd.commands.IndexActivateCommand.class ) ; command ( index , com.google.gerrit.sshd.commands.IndexStartCommand.class ) ; } command ( index , com.google.gerrit.sshd.commands.IndexChangesCommand.class ) ; command ( index , com.google.gerrit.sshd.commands.IndexProjectCommand.class ) ; }
Source:
public com.google.gerrit.extensions.common.AccountInfo accountInfo ( com.google.gerrit.reviewdb.client.Account a ) { if ( ( a == null ) || ( ( a.getId ( ) ) == null ) ) { return null ; } com.google.gerrit.extensions.common.AccountInfo ai = new com.google.gerrit.extensions.common.AccountInfo ( a.getId ( ) . get ( ) ) ; ai.email = a.getPreferredEmail ( ) ; ai.name = a.getFullName ( ) ; ai.username = a.getUserName ( ) ; return ai ; }

Target:
public com.google.gerrit.extensions.common.AccountInfo accountInfo ( com.google.gerrit.reviewdb.client.Account a ) { if ( ( a == null ) || ( ( a.getId ( ) ) == null ) ) { return null ; } return com.google.gerrit.server.account.AccountJson.toAccountInfo ( a ) ; }