auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private Change.Id createNewChange ( com.google.gerrit.server.update.BatchUpdate bu , com.google.gerrit.server.git.CodeReviewCommit cherryPickCommit , java.lang.String refName , java.lang.String topic , com.google.gerrit.reviewdb.client.Branch.NameKey sourceBranch ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change.Id changeId = new com.google.gerrit.reviewdb.client.Change.Id ( seq.nextChangeId ( ) ) ; com.google.gerrit.server.change.ChangeInserter ins = changeInserterFactory.create ( changeId , cherryPickCommit , refName ) . setValidatePolicy ( CommitValidators.Policy.GERRIT ) . setTopic ( topic ) ; ins.setMessage ( messageForDestinationChange ( ins.getPatchSetId ( ) , sourceBranch ) ) ; bu.insertChange ( ins ) ; return changeId ; }

Target:
private Change.Id createNewChange ( com.google.gerrit.server.update.BatchUpdate bu , com.google.gerrit.server.git.CodeReviewCommit cherryPickCommit , java.lang.String refName , java.lang.String topic , com.google.gerrit.reviewdb.client.Branch.NameKey sourceBranch , org.eclipse.jgit.lib.ObjectId sourceCommit ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change.Id changeId = new com.google.gerrit.reviewdb.client.Change.Id ( seq.nextChangeId ( ) ) ; com.google.gerrit.server.change.ChangeInserter ins = changeInserterFactory.create ( changeId , cherryPickCommit , refName ) . setValidatePolicy ( CommitValidators.Policy.GERRIT ) . setTopic ( topic ) ; ins.setMessage ( messageForDestinationChange ( ins.getPatchSetId ( ) , sourceBranch , sourceCommit ) ) ; bu.insertChange ( ins ) ; return changeId ; }
Source:
private boolean isChunk ( final int row ) { final java.lang.Object o = getRowItem ( row ) ; if ( ( ! ( onlyOneHunk ) ) && ( o instanceof com.google.gerrit.client.patches.PatchLine ) ) { final com.google.gerrit.client.patches.PatchLine pl = ( ( com.google.gerrit.client.patches.PatchLine ) ( o ) ) ; switch ( pl.getType ( ) ) { case DELETE : case INSERT : case REPLACE : return true ; } } else if ( o instanceof com.google.gerrit.client.patches.AbstractPatchContentTable.CommentList ) { return true ; } return false ; }

Target:
private boolean isChunk ( final int row ) { final java.lang.Object o = getRowItem ( row ) ; if ( ( ! ( onlyOneHunk ) ) && ( o instanceof com.google.gerrit.client.patches.PatchLine ) ) { final com.google.gerrit.client.patches.PatchLine pl = ( ( com.google.gerrit.client.patches.PatchLine ) ( o ) ) ; switch ( pl.getType ( ) ) { case DELETE : case INSERT : case REPLACE : return true ; case CONTEXT : break ; } } else if ( o instanceof com.google.gerrit.client.patches.AbstractPatchContentTable.CommentList ) { return true ; } return false ; }
Source:
protected void configure ( ) { bind ( com.googlesource.gerrit.plugins.serviceuser.ServiceUserCollection.class ) ; child ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "serviceusers" ) . to ( com.googlesource.gerrit.plugins.serviceuser.ServiceUserCollection.class ) ; install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . build ( CreateServiceUser.Factory.class ) ) ; get ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "messages" ) . to ( com.googlesource.gerrit.plugins.serviceuser.GetMessages.class ) ; }

Target:
protected void configure ( ) { bind ( com.googlesource.gerrit.plugins.serviceuser.ServiceUserCollection.class ) ; child ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "serviceusers" ) . to ( com.googlesource.gerrit.plugins.serviceuser.ServiceUserCollection.class ) ; install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . build ( CreateServiceUser.Factory.class ) ) ; get ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "messages" ) . to ( com.googlesource.gerrit.plugins.serviceuser.GetMessages.class ) ; put ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "messages" ) . to ( com.googlesource.gerrit.plugins.serviceuser.PutMessages.class ) ; }
Source:
private static void configureDefaults ( java.util.Map < java.lang.String , java.util.List < com.google.gerrit.common.data.PermissionRule > > res , com.google.gerrit.common.data.AccessSection section ) { com.google.gerrit.server.account.CapabilityControl.configureDefault ( res , section , GlobalCapability.QUERY_LIMIT , com.google.gerrit.server.account.CapabilityControl.anonymous ) ; }

Target:
private boolean matchAny ( java.util.List < com.google.gerrit.common.data.PermissionRule > rules ) { java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > groups = user.getEffectiveGroups ( ) ; for ( com.google.gerrit.common.data.PermissionRule rule : rules ) { if ( com.google.gerrit.server.account.CapabilityControl.match ( groups , rule ) ) { return true ; } } return false ; }
Source:
public void addMultipleIncludes ( ) throws java.lang.Exception { java.lang.String p = createGroup ( "parent" ) ; java.lang.String g1 = createGroup ( "newGroup1" ) ; java.lang.String g2 = createGroup ( "newGroup2" ) ; java.util.List < java.lang.String > groups = com.google.common.collect.Lists.newLinkedList ( ) ; groups.add ( g1 ) ; groups.add ( g2 ) ; gApi.groups ( ) . id ( p ) . addGroups ( g1 , g2 ) ; assertIncludes ( p , g1 , g2 ) ; }

Target:
public void addMultipleIncludes ( ) throws java.lang.Exception { java.lang.String p = createGroup ( "parent" ) ; java.lang.String g1 = createGroup ( "newGroup1" ) ; java.lang.String g2 = createGroup ( "newGroup2" ) ; java.util.List < java.lang.String > groups = new java.util.LinkedList < > ( ) ; groups.add ( g1 ) ; groups.add ( g2 ) ; gApi.groups ( ) . id ( p ) . addGroups ( g1 , g2 ) ; assertIncludes ( p , g1 , g2 ) ; }
Source:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.googlesource.gerrit.plugins.imagare.ImageResource.IMAGE_KIND ) ; bind ( com.googlesource.gerrit.plugins.imagare.ImagesCollection.class ) ; child ( com.google.gerrit.server.project.ProjectResource.PROJECT_KIND , "images" ) . to ( com.googlesource.gerrit.plugins.imagare.ImagesCollection.class ) ; get ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "config" ) . to ( com.googlesource.gerrit.plugins.imagare.GetConfig.class ) ; put ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "config" ) . to ( com.googlesource.gerrit.plugins.imagare.PutConfig.class ) ; get ( com.google.gerrit.server.account.AccountResource.ACCOUNT_KIND , "preference" ) . to ( com.googlesource.gerrit.plugins.imagare.GetPreference.class ) ; put ( com.google.gerrit.server.account.AccountResource.ACCOUNT_KIND , "preference" ) . to ( com.googlesource.gerrit.plugins.imagare.PutPreference.class ) ; }

Target:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.googlesource.gerrit.plugins.imagare.ImageResource.IMAGE_KIND ) ; bind ( com.googlesource.gerrit.plugins.imagare.ImagesCollection.class ) ; child ( com.google.gerrit.server.project.ProjectResource.PROJECT_KIND , "images" ) . to ( com.googlesource.gerrit.plugins.imagare.ImagesCollection.class ) ; delete ( com.googlesource.gerrit.plugins.imagare.ImageResource.IMAGE_KIND ) . to ( com.googlesource.gerrit.plugins.imagare.DeleteImage.class ) ; get ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "config" ) . to ( com.googlesource.gerrit.plugins.imagare.GetConfig.class ) ; put ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "config" ) . to ( com.googlesource.gerrit.plugins.imagare.PutConfig.class ) ; get ( com.google.gerrit.server.account.AccountResource.ACCOUNT_KIND , "preference" ) . to ( com.googlesource.gerrit.plugins.imagare.GetPreference.class ) ; put ( com.google.gerrit.server.account.AccountResource.ACCOUNT_KIND , "preference" ) . to ( com.googlesource.gerrit.plugins.imagare.PutPreference.class ) ; }
Source:
protected void configureServlets ( ) { serve ( "/static/*" ) . with ( com.google.gerrit.httpd.raw.SiteStaticDirectoryServlet.class ) ; serveGwtUi ( ) ; install ( new com.google.gerrit.server.cache.CacheModule ( ) { @ java.lang.Override protected void configure ( ) { cache ( com.google.gerrit.httpd.raw.StaticModule.CACHE , java.nio.file.Path.class , com.google.gerrit.httpd.raw.ResourceServlet.Resource.class ) . maximumWeight ( ( 1 << 20 ) ) . weigher ( ResourceServlet.Weigher.class ) ; } } ) ; }

Target:
protected void configureServlets ( ) { serve ( "/static/*" ) . with ( com.google.gerrit.httpd.raw.SiteStaticDirectoryServlet.class ) ; install ( new com.google.gerrit.server.cache.CacheModule ( ) { @ java.lang.Override protected void configure ( ) { cache ( com.google.gerrit.httpd.raw.StaticModule.CACHE , java.nio.file.Path.class , com.google.gerrit.httpd.raw.ResourceServlet.Resource.class ) . maximumWeight ( ( 1 << 20 ) ) . weigher ( ResourceServlet.Weigher.class ) ; } } ) ; if ( options.enablePolyGerrit ( ) ) { servePolyGerritUi ( ) ; } else if ( options.enableDefaultUi ( ) ) { serveGwtUi ( ) ; } }
Source:
private java.util.Set < com.google.gerrit.reviewdb.Account > listAccounts ( final com.google.gerrit.reviewdb.AccountGroup.UUID groupUUID , final com.google.gerrit.reviewdb.Project.NameKey project , final java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > seen ) throws com.google.gerrit.common.errors.NoSuchGroupException , com.google.gerrit.server.project.NoSuchProjectException , com.google.gwtorm.client.OrmException { if ( AccountGroup.PROJECT_OWNERS.equals ( groupUUID ) ) { return getProjectOwners ( project , seen ) ; } else { return getGroupMembers ( groupCache.get ( groupUUID ) , project , seen ) ; } }

Target:
private java.util.Set < com.google.gerrit.reviewdb.Account > listAccounts ( final com.google.gerrit.reviewdb.AccountGroup.UUID groupUUID , final com.google.gerrit.reviewdb.Project.NameKey project , final java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > seen ) throws com.google.gerrit.common.errors.NoSuchGroupException , com.google.gerrit.server.project.NoSuchProjectException , com.google.gwtorm.client.OrmException { if ( AccountGroup.PROJECT_OWNERS.equals ( groupUUID ) ) { return getProjectOwners ( project , seen ) ; } else { com.google.gerrit.reviewdb.AccountGroup group = groupCache.get ( groupUUID ) ; if ( group != null ) { return getGroupMembers ( group , project , seen ) ; } else { return java.util.Collections.emptySet ( ) ; } } }
Source:
public void listNonEmptyGroupIncludes ( ) throws java.lang.Exception { java.lang.String gx = group ( "gx" ) ; java.lang.String gy = group ( "gy" ) ; java.lang.String gz = group ( "gz" ) ; gApi.groups ( ) . id ( gx ) . addGroups ( gy ) ; gApi.groups ( ) . id ( gx ) . addGroups ( gz ) ; assertIncludes ( gApi.groups ( ) . id ( gx ) . includedGroups ( ) , gy , gz ) ; }

Target:
public void listNonEmptyGroupIncludes ( ) throws java.lang.Exception { java.lang.String gx = createGroup ( "gx" ) ; java.lang.String gy = createGroup ( "gy" ) ; java.lang.String gz = createGroup ( "gz" ) ; gApi.groups ( ) . id ( gx ) . addGroups ( gy ) ; gApi.groups ( ) . id ( gx ) . addGroups ( gz ) ; assertIncludes ( gApi.groups ( ) . id ( gx ) . includedGroups ( ) , gy , gz ) ; }
Source:
public void run ( ) { if ( ! ( prefs.renderEntireFile ( ) ) ) { 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 ) ; }

Target:
public boolean execute ( ) { if ( ( prefs.syntaxHighlighting ( ) ) && ( isAttached ( ) ) ) { setSyntaxHighlighting ( prefs.syntaxHighlighting ( ) ) ; } return false ; }
Source:
public void writeNoChanges ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , modifier.createEdit ( change , ps ) ) ; com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( change ) ; org.junit.Assert.assertTrue ( edit.isPresent ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , modifier.modifyFile ( edit.get ( ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME , org.eclipse.jgit.lib.Constants.encode ( com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_OLD ) ) ) ; }

Target:
public void writeNoChanges ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , modifier.createEdit ( change , ps ) ) ; try { modifier.modifyFile ( editUtil.byChange ( change ) . get ( ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME , com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_OLD ) ; org.junit.Assert.fail ( ) ; } catch ( com.google.gerrit.server.project.InvalidChangeOperationException e ) { org.junit.Assert.assertEquals ( "no changes were made" , e.getMessage ( ) ) ; } }
Source:
protected void ccExistingReviewers ( ) { try { for ( com.google.gerrit.reviewdb.client.Account.Id id : changeData.reviewers ( ) . get ( ReviewerState.REVIEWER ) ) { add ( RecipientType.CC , id ) ; } } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( "Cannot CC users that commented on updated change" , err ) ; } }

Target:
protected void ccExistingReviewers ( ) { try { for ( com.google.gerrit.reviewdb.client.Account.Id id : changeData.reviewers ( ) . get ( com.google.gerrit.server.notedb.ReviewerStateInternal.REVIEWER ) ) { add ( RecipientType.CC , id ) ; } } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( "Cannot CC users that commented on updated change" , err ) ; } }
Source:
com.google.gerrit.client.diff.DisplaySide displaySide ( com.google.gerrit.client.changes.CommentInfo info , com.google.gerrit.client.diff.DisplaySide forSide ) { if ( ( info.side ( ) ) == ( com.google.gerrit.extensions.client.Side.PARENT ) ) { return ( ( base ) == null ) || ( ( base.get ( ) ) < 0 ) ? DisplaySide.A : null ; } return forSide ; }

Target:
com.google.gerrit.client.diff.DisplaySide displaySide ( com.google.gerrit.client.changes.CommentInfo info , com.google.gerrit.client.diff.DisplaySide forSide ) { if ( ( info.side ( ) ) == ( com.google.gerrit.extensions.client.Side.PARENT ) ) { return ( base.isBaseOrAutoMerge ( ) ) || ( base.isParent ( ) ) ? DisplaySide.A : null ; } return forSide ; }
Source:
private void enableForm ( final boolean canModifyAgreements , final boolean canModifyDescription , final boolean canModifyMergeType , final boolean canModifyState , final boolean canModifyMaxObjectSizeLimit ) { submitType.setEnabled ( canModifyMergeType ) ; state.setEnabled ( canModifyState ) ; contentMerge.setEnabled ( canModifyMergeType ) ; descTxt.setEnabled ( canModifyDescription ) ; contributorAgreements.setEnabled ( canModifyAgreements ) ; signedOffBy.setEnabled ( canModifyAgreements ) ; requireChangeID.setEnabled ( canModifyMergeType ) ; maxObjectSizeLimit.setEnabled ( canModifyMaxObjectSizeLimit ) ; }

Target:
private void enableForm ( boolean isOwner ) { submitType.setEnabled ( isOwner ) ; state.setEnabled ( isOwner ) ; contentMerge.setEnabled ( isOwner ) ; descTxt.setEnabled ( isOwner ) ; contributorAgreements.setEnabled ( isOwner ) ; signedOffBy.setEnabled ( isOwner ) ; requireChangeID.setEnabled ( isOwner ) ; maxObjectSizeLimit.setEnabled ( isOwner ) ; }
Source:
private com.google.gerrit.server.project.ProjectState newProjectState ( ) { com.google.gerrit.server.project.ProjectCache projectCache = null ; com.google.gerrit.reviewdb.Project.NameKey wildProject = null ; com.google.gerrit.server.project.ProjectState ps = new com.google.gerrit.server.project.ProjectState ( anonymousUser , projectCache , wildProject , new com.google.gerrit.reviewdb.Project ( projectNameKey ) , local ) ; ps.setInheritedRights ( inherited ) ; return ps ; }

Target:
private com.google.gerrit.server.project.ProjectState newProjectState ( ) { com.google.gerrit.server.project.ProjectCache projectCache = null ; com.google.gerrit.reviewdb.Project.NameKey wildProject = null ; com.google.gerrit.server.project.ProjectControl.AssistedFactory projectControlFactory = null ; com.google.gerrit.server.project.ProjectState ps = new com.google.gerrit.server.project.ProjectState ( anonymousUser , projectCache , wildProject , projectControlFactory , new com.google.gerrit.reviewdb.Project ( projectNameKey ) , local ) ; ps.setInheritedRights ( inherited ) ; return ps ; }
Source:
public static void display ( final java.lang.String token , final com.google.gerrit.client.ui.Screen view ) { if ( ( view.isRequiresSignIn ( ) ) && ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( token ) ; } else { view.setToken ( token ) ; com.google.gerrit.client.Gerrit.body.setView ( view ) ; } }

Target:
public static void display ( final java.lang.String token , final com.google.gerrit.client.ui.Screen view ) { if ( ( view.isRequiresSignIn ( ) ) && ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( token ) ; } else { view.setToken ( token ) ; if ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) { com.google.gerrit.client.change.LocalComments.saveInlineComments ( ) ; } com.google.gerrit.client.Gerrit.body.setView ( view ) ; } }
Source:
private static com.google.gerrit.client.SignInDialog.Mode signInMode ( final javax.servlet.http.HttpServletRequest req ) { final java.lang.String p = req.getParameter ( com.google.gerrit.server.OpenIdLoginServlet.SIGNIN_MODE_PARAMETER ) ; if ( ( p == null ) || ( ( p.length ( ) ) == 0 ) ) { return com.google.gerrit.client.SignInDialog.Mode.SIGN_IN ; } try { return SignInDialog.Mode.valueOf ( p ) ; } catch ( java.lang.RuntimeException e ) { return com.google.gerrit.client.SignInDialog.Mode.SIGN_IN ; } }

Target:
private static com.google.gerrit.client.SignInDialog.Mode signInMode ( final javax.servlet.http.HttpServletRequest req ) { final java.lang.String p = req.getParameter ( OpenIdUtil.P_SIGNIN_MODE ) ; if ( ( p == null ) || ( ( p.length ( ) ) == 0 ) ) { return com.google.gerrit.client.SignInDialog.Mode.SIGN_IN ; } try { return SignInDialog.Mode.valueOf ( p ) ; } catch ( java.lang.RuntimeException e ) { return com.google.gerrit.client.SignInDialog.Mode.SIGN_IN ; } }
Source:
public void unblockLargerScope_Fails ( ) { com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/master" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertCannotUpdate ( "refs/heads/master" , u ) ; }

Target:
public void unblockInParentBlockInLocal ( ) { com.google.gerrit.server.project.testing.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.testing.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.testing.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.testing.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl d = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; assertCannotUpdate ( "refs/heads/master" , d ) ; }
Source:
protected com.google.gerrit.server.notedb.ChangeUpdate newUpdate ( com.google.gerrit.reviewdb.client.Change c , com.google.gerrit.server.IdentifiedUser user ) throws com.google.gwtorm.server.OrmException { return com.google.gerrit.testutil.TestChanges.newUpdate ( injector , repoManager , com.google.gerrit.server.notedb.AbstractChangeNotesTest.MIGRATION , c , allUsers , user ) ; }

Target:
protected com.google.gerrit.server.notedb.ChangeUpdate newUpdate ( com.google.gerrit.reviewdb.client.Change c , com.google.gerrit.server.IdentifiedUser user ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.notedb.ChangeUpdate update = com.google.gerrit.testutil.TestChanges.newUpdate ( injector , repoManager , com.google.gerrit.server.notedb.AbstractChangeNotesTest.MIGRATION , c , allUsers , user ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openMetadataRepository ( c.getProject ( ) ) ) { update.load ( repo ) ; } return update ; }
Source:
public static void amendCommit ( org.eclipse.jgit.api.Git git , org.eclipse.jgit.lib.PersonIdent i , java.lang.String msg , java.lang.String changeId ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { msg = org.eclipse.jgit.util.ChangeIdUtil.insertId ( msg , org.eclipse.jgit.lib.ObjectId.fromString ( changeId.substring ( 1 ) ) ) ; com.google.gerrit.acceptance.git.GitUtil.createCommit ( git , i , msg , false , true ) ; }

Target:
public static com.google.gerrit.acceptance.git.GitUtil.Commit amendCommit ( org.eclipse.jgit.api.Git git , org.eclipse.jgit.lib.PersonIdent i , java.lang.String msg , java.lang.String changeId ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { msg = org.eclipse.jgit.util.ChangeIdUtil.insertId ( msg , org.eclipse.jgit.lib.ObjectId.fromString ( changeId.substring ( 1 ) ) ) ; return com.google.gerrit.acceptance.git.GitUtil.createCommit ( git , i , msg , changeId ) ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { com.google.gwt.core.client.GWT.log ( "Unexpected failure from validating account" , caught ) ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; showInitialScreen ( ) ; }

Target:
public void onFailure ( final java.lang.Throwable caught ) { if ( ( ! ( com.google.gwt.core.client.GWT.isScript ( ) ) ) && ( ! ( com.google.gerrit.client.rpc.GerritCallback.isNotSignedIn ( caught ) ) ) ) { com.google.gwt.core.client.GWT.log ( "Unexpected failure from validating account" , caught ) ; } com.google.gwt.user.client.Cookies.removeCookie ( com.google.gerrit.client.Gerrit.ACCOUNT_COOKIE ) ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; showInitialScreen ( ) ; }
Source:
public void testDoPostWrongMediaType ( ) throws java.lang.Exception { org.mockito.Mockito.when ( req.getContentType ( ) ) . thenReturn ( com.google.common.net.MediaType.APPLICATION_XML_UTF_8.toString ( ) ) ; syncEventsRestApiServlet.doPost ( req , rsp ) ; org.mockito.Mockito.verify ( rsp ) . sendError ( javax.servlet.http.HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE , ( ( "Expecting " + ( com.google.common.net.MediaType.JSON_UTF_8.toString ( ) ) ) + " content type" ) ) ; }

Target:
public void testDoPostWrongMediaType ( ) throws java.lang.Exception { org.mockito.Mockito.when ( req.getContentType ( ) ) . thenReturn ( com.google.common.net.MediaType.APPLICATION_XML_UTF_8.toString ( ) ) ; eventRestApiServlet.doPost ( req , rsp ) ; org.mockito.Mockito.verify ( rsp ) . sendError ( javax.servlet.http.HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE , ( ( "Expecting " + ( com.google.common.net.MediaType.JSON_UTF_8.toString ( ) ) ) + " content type" ) ) ; }
Source:
private void saveLabelConfig ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; cfg.getLabelSections ( ) . put ( label.getName ( ) , label ) ; cfg.getLabelSections ( ) . put ( pLabel.getName ( ) , pLabel ) ; saveProjectConfig ( project , cfg ) ; }

Target:
private void saveLabelConfig ( ) throws java.lang.Exception { com.google.gerrit.server.project.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; cfg.getLabelSections ( ) . put ( label.getName ( ) , label ) ; cfg.getLabelSections ( ) . put ( pLabel.getName ( ) , pLabel ) ; saveProjectConfig ( project , cfg ) ; }
Source:
public void defaultMessage ( ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( ) ; com.google.gerrit.acceptance.rest.change.ChangeInfo c = getChangeWithMessages ( changeId ) ; org.junit.Assert.assertNotNull ( c.messages ) ; org.junit.Assert.assertEquals ( 1 , c.messages.size ( ) ) ; org.junit.Assert.assertEquals ( "Uploaded patch set 1." , c.messages.get ( 0 ) . message ) ; }

Target:
public void defaultMessage ( ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( ) ; com.google.gerrit.server.change.ChangeJson.ChangeInfo c = getChangeWithMessages ( changeId ) ; org.junit.Assert.assertNotNull ( c.messages ) ; org.junit.Assert.assertEquals ( 1 , c.messages.size ( ) ) ; org.junit.Assert.assertEquals ( "Uploaded patch set 1." , c.messages.iterator ( ) . next ( ) . message ) ; }
Source:
public void testTokenSerializationDeserialization ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestTokenProessor processor = new com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestTokenProessor ( cipher ) ; com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken token = new com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken ( 0 ) ; java.lang.String serialized = processor.serialize ( token ) ; com.google.common.truth.Truth.assertThat ( serialized ) . isNotEmpty ( ) ; java.util.Optional < com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken > deserialized = processor.deserialize ( serialized ) ; com.google.common.truth.Truth.assertThat ( deserialized.isPresent ( ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( token.expiresAt ) . isEqualTo ( deserialized.get ( ) . expiresAt ) ; }

Target:
public void testTokenSerializationDeserialization ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestTokenProessor processor = new com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestTokenProessor ( cipher ) ; com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken token = new com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken ( java.time.Instant.now ( ) , 0L ) ; java.lang.String serialized = processor.serialize ( token ) ; com.google.common.truth.Truth.assertThat ( serialized ) . isNotEmpty ( ) ; java.util.Optional < com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken > deserialized = processor.deserialize ( serialized ) ; com.google.common.truth.Truth.assertThat ( deserialized.isPresent ( ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( token.issued ) . isEqualTo ( deserialized.get ( ) . issued ) ; }
Source:
public void groupDetail ( final com.google.gerrit.reviewdb.AccountGroup.Id groupId , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.GroupDetail > callback ) { groupDetailFactory.create ( groupId ) . to ( callback ) ; }

Target:
public void groupDetail ( com.google.gerrit.reviewdb.AccountGroup.Id groupId , com.google.gerrit.reviewdb.AccountGroup.UUID groupUUID , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.GroupDetail > callback ) { if ( ( groupId == null ) && ( groupUUID != null ) ) { com.google.gerrit.reviewdb.AccountGroup g = groupCache.get ( groupUUID ) ; if ( g != null ) { groupId = g.getId ( ) ; } } groupDetailFactory.create ( groupId ) . to ( callback ) ; }
Source:
private AccountGroup.Id owner ( com.google.gerrit.server.group.CreateGroup.Input input ) throws com.google.gerrit.extensions.restapi.UnprocessableEntityException { if ( ( input.ownerId ) != null ) { com.google.gerrit.common.data.GroupDescription.Basic d = groups.parseInternal ( com.google.gerrit.extensions.restapi.Url.decode ( input.ownerId ) ) ; return com.google.gerrit.common.data.GroupDescriptions.toAccountGroup ( d ) . getId ( ) ; } return null ; }

Target:
private AccountGroup.Id owner ( com.google.gerrit.extensions.api.groups.GroupInput input ) throws com.google.gerrit.extensions.restapi.UnprocessableEntityException { if ( ( input.ownerId ) != null ) { com.google.gerrit.common.data.GroupDescription.Basic d = groups.parseInternal ( com.google.gerrit.extensions.restapi.Url.decode ( input.ownerId ) ) ; return com.google.gerrit.common.data.GroupDescriptions.toAccountGroup ( d ) . getId ( ) ; } return null ; }
Source:
private java.lang.String getChangeUrl ( final com.google.gerrit.reviewdb.Change change ) { if ( ( change != null ) && ( ( urlProvider.get ( ) ) != null ) ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( urlProvider.get ( ) ) ; r.append ( change.getChangeId ( ) ) ; return r.toString ( ) ; } return null ; }

Target:
public com.google.gerrit.server.events.PatchSetAttribute asPatchSetAttribute ( final com.google.gerrit.reviewdb.client.PatchSet patchSet ) { com.google.gerrit.server.events.PatchSetAttribute p = new com.google.gerrit.server.events.PatchSetAttribute ( ) ; p.revision = patchSet.getRevision ( ) . get ( ) ; p.number = java.lang.Integer.toString ( patchSet.getPatchSetId ( ) ) ; p.ref = patchSet.getRefName ( ) ; p.uploader = asAccountAttribute ( patchSet.getUploader ( ) ) ; p.createdOn = ( patchSet.getCreatedOn ( ) . getTime ( ) ) / 1000L ; return p ; }
Source:
protected boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Account.Id to ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException { return args.permissionBackend.user ( args.identifiedUserFactory.create ( to ) ) . change ( changeData ) . database ( args.db.get ( ) ) . test ( ChangePermission.READ ) ; }

Target:
protected boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Account.Id to ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException { return ( projectState.statePermitsRead ( ) ) && ( args.permissionBackend.user ( args.identifiedUserFactory.create ( to ) ) . change ( changeData ) . database ( args.db.get ( ) ) . test ( ChangePermission.READ ) ) ; }
Source:
private org.asciidoctor.Options createOptions ( java.io.File tmpFile ) { org.asciidoctor.OptionsBuilder optionsBuilder = org.asciidoctor.OptionsBuilder.options ( ) ; optionsBuilder.backend ( backend ) . docType ( Main.DOCTYPE ) . eruby ( Main.ERUBY ) ; optionsBuilder.toFile ( tmpFile ) ; org.asciidoctor.AttributesBuilder attributesBuilder = org.asciidoctor.AttributesBuilder.attributes ( ) ; attributesBuilder.attributes ( getAttributes ( ) ) ; optionsBuilder.attributes ( attributesBuilder.get ( ) ) ; return optionsBuilder.get ( ) ; }

Target:
private org.asciidoctor.Options createOptions ( java.io.File tmpFile ) { org.asciidoctor.OptionsBuilder optionsBuilder = org.asciidoctor.OptionsBuilder.options ( ) ; optionsBuilder.backend ( backend ) . docType ( AsciiDoctor.DOCTYPE ) . eruby ( AsciiDoctor.ERUBY ) ; optionsBuilder.toFile ( tmpFile ) ; org.asciidoctor.AttributesBuilder attributesBuilder = org.asciidoctor.AttributesBuilder.attributes ( ) ; attributesBuilder.attributes ( getAttributes ( ) ) ; optionsBuilder.attributes ( attributesBuilder.get ( ) ) ; return optionsBuilder.get ( ) ; }
Source:
public static < V > java.util.Map < java.lang.String , org.eclipse.jgit.lib.Config > asConfigMap ( com.google.gerrit.server.index.SchemaDefinitions < V > schemaDef , java.util.List < java.lang.Integer > schemaVersions , java.lang.String testSuiteNamePrefix , org.eclipse.jgit.lib.Config baseConfig ) { return schemaVersions.stream ( ) . collect ( java.util.stream.Collectors.toMap ( ( i ) -> testSuiteNamePrefix + i , ( i ) -> { org.eclipse.jgit.lib.Config cfg = baseConfig ; cfg.setInt ( "index" , "lucene" , ( ( schemaDef.getName ( ) . toLowerCase ( ) ) + "TestVersion" ) , i ) ; return cfg ; } ) ) ; }

Target:
public static < V > java.util.Map < java.lang.String , org.eclipse.jgit.lib.Config > asConfigMap ( com.google.gerrit.index.SchemaDefinitions < V > schemaDef , java.util.List < java.lang.Integer > schemaVersions , java.lang.String testSuiteNamePrefix , org.eclipse.jgit.lib.Config baseConfig ) { return schemaVersions.stream ( ) . collect ( java.util.stream.Collectors.toMap ( ( i ) -> testSuiteNamePrefix + i , ( i ) -> { org.eclipse.jgit.lib.Config cfg = baseConfig ; cfg.setInt ( "index" , "lucene" , ( ( schemaDef.getName ( ) . toLowerCase ( ) ) + "TestVersion" ) , i ) ; return cfg ; } ) ) ; }
Source:
public void blockPushDraftsUnblockAdmin ( ) { com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/drafts/*" ) ; com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ADMIN , "refs/drafts/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; com.google.gerrit.server.project.ProjectControl a = user ( local , "a" , com.google.gerrit.server.project.Util.ADMIN ) ; assertBlocked ( com.google.gerrit.common.data.Permission.PUSH , "refs/drafts/refs/heads/master" , u ) ; assertNotBlocked ( com.google.gerrit.common.data.Permission.PUSH , "refs/drafts/refs/heads/master" , a ) ; }

Target:
public void blockPushDraftsUnblockAdmin ( ) { com.google.gerrit.server.project.testing.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/drafts/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.testing.Util.ADMIN , "refs/drafts/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; com.google.gerrit.server.project.ProjectControl a = user ( local , "a" , com.google.gerrit.server.project.testing.Util.ADMIN ) ; assertBlocked ( com.google.gerrit.common.data.Permission.PUSH , "refs/drafts/refs/heads/master" , u ) ; assertNotBlocked ( com.google.gerrit.common.data.Permission.PUSH , "refs/drafts/refs/heads/master" , a ) ; }
Source:
public WorkQueue.Executor createMergeabilityChecksExecutor ( @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config config , com.google.gerrit.server.git.WorkQueue queues , @ com.google.gerrit.server.change.MergeabilityChecksExecutor ( value = com.google.gerrit.server.change.MergeabilityChecksExecutor.Priority.BACKGROUND ) com.google.gerrit.server.git.WorkQueue.Executor backgroundExecutor ) { int poolSize = config.getInt ( "changeMerge" , null , "interactiveThreadPoolSize" , 1 ) ; if ( poolSize <= 0 ) { return backgroundExecutor ; } return queues.createQueue ( poolSize , "InteractiveMergeabilityChecks" ) ; }

Target:
public WorkQueue.Executor createMergeabilityChecksExecutor ( @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config config , com.google.gerrit.server.git.WorkQueue queues , @ com.google.gerrit.server.change.MergeabilityChecksExecutor ( value = com.google.gerrit.server.change.MergeabilityChecksExecutor.Priority.BACKGROUND ) com.google.gerrit.server.git.WorkQueue.Executor backgroundExecutor ) { int poolSize = config.getInt ( "changeMerge" , null , "interactiveThreadPoolSize" , 1 ) ; if ( poolSize <= 0 ) { return backgroundExecutor ; } return queues.createQueue ( poolSize , "MergeabilityChecks-Interactive" ) ; }
Source:
protected void assertCurrentRevision ( java.lang.String changeId , int expectedNum , org.eclipse.jgit.lib.ObjectId expectedId ) throws java.io.IOException { com.google.gerrit.extensions.common.ChangeInfo c = getChange ( changeId , com.google.gerrit.extensions.common.ListChangesOption.CURRENT_REVISION ) ; com.google.common.truth.Truth.assertThat ( c.currentRevision ) . isEqualTo ( expectedId.name ( ) ) ; com.google.common.truth.Truth.assertThat ( c.revisions.get ( expectedId.name ( ) ) . _number ) . isEqualTo ( expectedNum ) ; }

Target:
protected void assertApproved ( java.lang.String changeId ) throws java.io.IOException { com.google.gerrit.extensions.common.ChangeInfo c = getChange ( changeId , com.google.gerrit.extensions.client.ListChangesOption.DETAILED_LABELS ) ; com.google.gerrit.extensions.common.LabelInfo cr = c.labels.get ( "Code-Review" ) ; com.google.common.truth.Truth.assertThat ( cr.all ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( cr.all.get ( 0 ) . value.intValue ( ) ) . isEqualTo ( 2 ) ; com.google.common.truth.Truth.assertThat ( new com.google.gerrit.reviewdb.client.Account.Id ( cr.all.get ( 0 ) . _accountId ) ) . isEqualTo ( admin.getId ( ) ) ; }
Source:
public boolean deleteChangeFromIndex ( int changeId ) { try { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult result = httpSession.delete ( buildIndexEndpoint ( changeId ) ) ; if ( result.isSuccessful ( ) ) { return true ; } com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.log.error ( "Unable to delete from index change {}. Cause: {}" , changeId , result.getMessage ( ) ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.log.error ( ( "Error trying to delete from index change " + changeId ) , e ) ; } return false ; }

Target:
boolean execute ( ) { try { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult result = send ( ) ; if ( result.isSuccessful ( ) ) { return true ; } com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.log.error ( "Unable to {}: {}" , name , result.getMessage ( ) ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.log.error ( "Error trying to {}" , name , e ) ; } return false ; }
Source:
public void onLoad ( ) { super . onLoad ( ) ; Util.ACCOUNT_SVC.myAccount ( new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.reviewdb.Account > ( ) { public void onFailure ( java.lang.Throwable caught ) { com.google.gwt.core.client.GWT.log ( "myAccount failed" , caught ) ; } public void onSuccess ( com.google.gerrit.client.reviewdb.Account result ) { com.google.gwt.core.client.GWT.log ( ( "yay, i am " + ( result.getPreferredEmail ( ) ) ) , null ) ; com.google.gwt.core.client.GWT.log ( ( "created on " + ( result.getRegisteredOn ( ) ) ) , null ) ; } } ) ; }

Target:
public void onLoad ( ) { super . onLoad ( ) ; Util.ACCOUNT_SVC.myAccount ( new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.reviewdb.Account > ( ) { public void onSuccess ( com.google.gerrit.client.reviewdb.Account result ) { com.google.gwt.core.client.GWT.log ( ( "yay, i am " + ( result.getPreferredEmail ( ) ) ) , null ) ; com.google.gwt.core.client.GWT.log ( ( "created on " + ( result.getRegisteredOn ( ) ) ) , null ) ; } } ) ; }
Source:
public void index ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) throws java.io.IOException { for ( com.google.gerrit.index.Index < com.google.gerrit.reviewdb.client.AccountGroup.UUID , com.google.gerrit.server.group.InternalGroup > i : getWriteIndexes ( ) ) { java.util.Optional < com.google.gerrit.server.group.InternalGroup > internalGroup = groupCache.get ( uuid ) ; if ( internalGroup.isPresent ( ) ) { i.replace ( internalGroup.get ( ) ) ; } else { i.delete ( uuid ) ; } } fireGroupIndexedEvent ( uuid.get ( ) ) ; }

Target:
public void index ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) throws java.io.IOException { for ( com.google.gerrit.index.Index < com.google.gerrit.reviewdb.client.AccountGroup.UUID , com.google.gerrit.server.group.InternalGroup > i : getWriteIndexes ( ) ) { java.util.Optional < com.google.gerrit.server.group.InternalGroup > internalGroup = groupCache.get ( uuid ) ; if ( internalGroup.isPresent ( ) ) { i.replace ( internalGroup.get ( ) ) ; } else { i.delete ( uuid ) ; } } fireGroupIndexedEvent ( uuid.get ( ) ) ; com.google.gerrit.server.index.group.GroupIndexerImpl.autoReindexIfStale ( uuid ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.changes.ChangeList result ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.change.RelatedChanges.ChangeAndCommit > changes = convertChangeList ( result ) ; if ( ( changes.length ( ) ) > 0 ) { getTab ( ) . setTitle ( Resources.M.cherryPicks ( changes.length ( ) ) ) ; getTab ( ) . setChanges ( info.project ( ) , revision , changes ) ; } }

Target:
private void setTabEnabled ( com.google.gerrit.client.change.RelatedChanges.Tab tabInfo , boolean enabled ) { getTabBar ( ) . setTabEnabled ( tabInfo.ordinal ( ) , enabled ) ; }
Source:
void set ( com.google.gerrit.client.info.ChangeInfo info ) { this . changeId = info.legacyId ( ) ; assigneeLink.setText ( ( ( info.assignee ( ) ) != null ? info.assignee ( ) . name ( ) : "" ) ) ; assigneeSuggestOracle.setChange ( changeId ) ; editAssigneeIcon.setVisible ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ; }

Target:
void set ( com.google.gerrit.client.info.ChangeInfo info ) { this . changeId = info.legacyId ( ) ; this . canEdit = ( info.hasActions ( ) ) && ( info.actions ( ) . containsKey ( "assignee" ) ) ; setAssignee ( info.assignee ( ) ) ; assigneeSuggestOracle.setChange ( changeId ) ; editAssigneeIcon.setVisible ( canEdit ) ; if ( ! ( canEdit ) ) { show.setTitle ( null ) ; } }
Source:
public synchronized com.google.gerrit.testutil.InMemoryRepositoryManager.Repo createRepository ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws com.google.gerrit.server.git.RepositoryCaseMismatchException , org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.gerrit.testutil.InMemoryRepositoryManager.Repo repo ; try { repo = get ( name ) ; if ( ! ( repo.getDescription ( ) . getRepositoryName ( ) . equals ( name.get ( ) ) ) ) { throw new com.google.gerrit.server.git.RepositoryCaseMismatchException ( name ) ; } } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException e ) { repo = new com.google.gerrit.testutil.InMemoryRepositoryManager.Repo ( name ) ; repos.put ( com.google.gerrit.testutil.InMemoryRepositoryManager.normalize ( name ) , repo ) ; } return repo ; }

Target:
public synchronized com.google.gerrit.testing.InMemoryRepositoryManager.Repo createRepository ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws com.google.gerrit.server.git.RepositoryCaseMismatchException , org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.gerrit.testing.InMemoryRepositoryManager.Repo repo ; try { repo = get ( name ) ; if ( ! ( repo.getDescription ( ) . getRepositoryName ( ) . equals ( name.get ( ) ) ) ) { throw new com.google.gerrit.server.git.RepositoryCaseMismatchException ( name ) ; } } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException e ) { repo = new com.google.gerrit.testing.InMemoryRepositoryManager.Repo ( name ) ; repos.put ( com.google.gerrit.testing.InMemoryRepositoryManager.normalize ( name ) , repo ) ; } return repo ; }
Source:
private org.apache.lucene.search.Query not ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p ) throws com.google.gerrit.server.query.QueryParseException { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > n = p.getChild ( 0 ) ; if ( n instanceof com.google.gerrit.server.index.TimestampRangePredicate ) { return notTimestamp ( ( ( com.google.gerrit.server.index.TimestampRangePredicate < com.google.gerrit.server.query.change.ChangeData > ) ( n ) ) ) ; } org.apache.lucene.search.BooleanQuery q = new org.apache.lucene.search.BooleanQuery ( ) ; q.add ( new org.apache.lucene.search.MatchAllDocsQuery ( ) , org.apache.lucene.search.BooleanClause.Occur.MUST ) ; q.add ( toQuery ( n ) , org.apache.lucene.search.BooleanClause.Occur.MUST_NOT ) ; return q ; }

Target:
private org.apache.lucene.search.Query not ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p ) throws com.google.gerrit.server.query.QueryParseException { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > n = p.getChild ( 0 ) ; if ( n instanceof com.google.gerrit.server.index.TimestampRangePredicate ) { return notTimestamp ( ( ( com.google.gerrit.server.index.TimestampRangePredicate < com.google.gerrit.server.query.change.ChangeData > ) ( n ) ) ) ; } return new org.apache.lucene.search.BooleanQuery.Builder ( ) . add ( new org.apache.lucene.search.MatchAllDocsQuery ( ) , org.apache.lucene.search.BooleanClause.Occur.MUST ) . add ( toQuery ( n ) , org.apache.lucene.search.BooleanClause.Occur.MUST_NOT ) . build ( ) ; }
Source:
private static java.util.Set < com.google.gerrit.reviewdb.Account.Id > pack ( final java.util.Set < com.google.gerrit.reviewdb.Account.Id > c ) { switch ( c.size ( ) ) { case 0 : return java.util.Collections.emptySet ( ) ; case 1 : return com.google.gerrit.server.account.AccountByEmailCacheImpl.one ( c ) ; default : return java.util.Collections.unmodifiableSet ( new java.util.HashSet < com.google.gerrit.reviewdb.Account.Id > ( c ) ) ; } }

Target:
private static java.util.Set < com.google.gerrit.reviewdb.Account.Id > pack ( final java.util.Set < com.google.gerrit.reviewdb.Account.Id > c ) { switch ( c.size ( ) ) { case 0 : return java.util.Collections.emptySet ( ) ; case 1 : return com.google.gerrit.server.account.AccountByEmailCacheImpl.Loader.one ( c ) ; default : return java.util.Collections.unmodifiableSet ( new java.util.HashSet < com.google.gerrit.reviewdb.Account.Id > ( c ) ) ; } }
Source:
public static void isGroupOwner ( java.lang.String groupName , final com.google.gwt.user.client.rpc.AsyncCallback < java.lang.Boolean > cb ) { com.google.gerrit.client.groups.GroupList.myOwned ( groupName , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.groups.GroupList > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.groups.GroupList result ) { cb.onSuccess ( ( ! ( result.asList ( ) . isEmpty ( ) ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { cb.onFailure ( caught ) ; } } ) ; }

Target:
public static void isGroupOwner ( java.lang.String groupName , final com.google.gwt.user.client.rpc.AsyncCallback < java.lang.Boolean > cb ) { com.google.gerrit.client.groups.GroupMap.myOwned ( groupName , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.groups.GroupMap > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.groups.GroupMap result ) { cb.onSuccess ( ( ! ( result.isEmpty ( ) ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { cb.onFailure ( caught ) ; } } ) ; }
Source:
public void onResponseReceived ( com.google.gwt.http.client.Request request , com.google.gwt.http.client.Response response ) { int status = response.getStatusCode ( ) ; if ( ( 200 <= status ) && ( status < 300 ) ) { java.lang.String frameId = "xdoc_iframe" ; com.google.gwt.user.client.ui.Frame frame = new com.google.gwt.user.client.ui.Frame ( url ) ; frame.getElement ( ) . setId ( frameId ) ; resize ( frame , frameId ) ; add ( frame ) ; } else { showError ( ( ( status + " " ) + ( response.getStatusText ( ) ) ) ) ; } }

Target:
public void onResponseReceived ( com.google.gwt.http.client.Request request , com.google.gwt.http.client.Response response ) { int status = response.getStatusCode ( ) ; if ( ( 200 <= status ) && ( status < 300 ) ) { java.lang.String frameId = "xdoc_iframe" ; com.google.gwt.user.client.ui.Frame frame = new com.google.gwt.user.client.ui.Frame ( url ) ; frame.getElement ( ) . setId ( frameId ) ; com.googlesource.gerrit.plugins.xdocs.client.XDocScreen.resize ( frame , frameId ) ; add ( frame ) ; } else { showError ( ( ( status + " " ) + ( response.getStatusText ( ) ) ) ) ; } }
Source:
private com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > createEdit ( com.google.gerrit.reviewdb.client.Change change ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException , java.io.IOException { editModifier.createEdit ( change , db.get ( ) . patchSets ( ) . get ( change.currentPatchSetId ( ) ) ) ; return editUtil.byChange ( change ) ; }

Target:
private com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > createEdit ( com.google.gerrit.server.change.ChangeResource resource ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException , java.io.IOException { editModifier.createEdit ( resource.getChange ( ) , psUtil.current ( db.get ( ) , resource.getNotes ( ) ) ) ; return editUtil.byChange ( resource.getChange ( ) ) ; }