auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private com.google.gerrit.extensions.common.CommentInfo getDraftComment ( java.lang.String changeId , java.lang.String revId , java.lang.String uuid ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = userSession.get ( ( ( ( ( ( "/changes/" + changeId ) + "/revisions/" ) + revId ) + "/drafts/" ) + uuid ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; return newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.CommentInfo.class ) ; }

Target:
private void deleteDraft ( java.lang.String changeId , java.lang.String revId , java.lang.String uuid ) throws java.lang.Exception { gApi.changes ( ) . id ( changeId ) . revision ( revId ) . draft ( uuid ) . delete ( ) ; }
Source:
private void deleteRemoteSsh ( org.eclipse.jgit.transport.URIish uri ) { java.lang.String quotedPath = QuotedString.BOURNE.quote ( uri.getPath ( ) ) ; java.lang.String cmd = "rm -rf " + quotedPath ; java.io.OutputStream errStream = com.googlesource.gerrit.plugins.replication.ReplicationQueue.newErrorBufferStream ( ) ; try { executeRemoteSsh ( uri , cmd , errStream ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.error ( java.lang.String.format ( ( "Error deleting remote repository at %s:\n" + ( ( " Exception: %s\n" + " Command: %s\n" ) + " Output: %s" ) ) , uri , e , cmd , errStream ) , e ) ; } }

Target:
private void deleteRemoteSsh ( org.eclipse.jgit.transport.URIish uri ) { java.lang.String quotedPath = QuotedString.BOURNE.quote ( uri.getPath ( ) ) ; java.lang.String cmd = "rm -rf " + quotedPath ; java.io.OutputStream errStream = com.googlesource.gerrit.plugins.replication.ReplicationQueue.newErrorBufferStream ( ) ; try { executeRemoteSsh ( uri , cmd , errStream ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.error ( ( "Error deleting remote repository at {}:\n" + ( ( " Exception: {}\n" + " Command: {}\n" ) + " Output: {}" ) ) , uri , e , cmd , errStream , e ) ; } }
Source:
public void deleteBranchesNotFoundContinue ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.DeleteBranchesInput input = new com.google.gerrit.extensions.api.projects.DeleteBranchesInput ( ) ; java.util.List < java.lang.String > branches = com.google.common.collect.Lists.newArrayList ( "refs/heads/does-not-exist" ) ; branches.addAll ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; input.branches = branches ; try { project ( ) . deleteBranches ( input ) ; org.junit.Assert.fail ( "Expected ResourceConflictException" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceConflictException e ) { com.google.common.truth.Truth.assertThat ( e ) . hasMessage ( errorMessageForBranches ( com.google.common.collect.ImmutableList.of ( "refs/heads/does-not-exist" ) ) ) ; } assertBranchesDeleted ( ) ; }

Target:
public void deleteBranchesNotFoundContinue ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.DeleteBranchesInput input = new com.google.gerrit.extensions.api.projects.DeleteBranchesInput ( ) ; java.util.List < java.lang.String > branches = com.google.common.collect.Lists.newArrayList ( "refs/heads/does-not-exist" ) ; branches.addAll ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; input.branches = branches ; try { project ( ) . deleteBranches ( input ) ; org.junit.Assert.fail ( "Expected ResourceConflictException" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceConflictException e ) { com.google.common.truth.Truth.assertThat ( e ) . hasMessageThat ( ) . isEqualTo ( errorMessageForBranches ( com.google.common.collect.ImmutableList.of ( "refs/heads/does-not-exist" ) ) ) ; } assertBranchesDeleted ( ) ; }
Source:
public void run ( ) { if ( cmSrc.hasActiveLine ( ) ) { cmDst.setCursor ( net.codemirror.lib.LineCharacter.create ( lineOnOther ( sideSrc , cmSrc.getLineNumber ( cmSrc.getActiveLine ( ) ) ) . getLine ( ) ) ) ; } cmDst.focus ( ) ; }

Target:
public void run ( ) { if ( cmSrc.hasActiveLine ( ) ) { cmDst.setCursor ( net.codemirror.lib.Pos.create ( lineOnOther ( sideSrc , cmSrc.getLineNumber ( cmSrc.activeLine ( ) ) ) . getLine ( ) ) ) ; } cmDst.focus ( ) ; }
Source:
public void insertComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) throws com.google.gwtorm.server.OrmException { verifyComment ( c ) ; com.google.common.base.Preconditions.checkArgument ( ( ( c.getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.PatchLineComment.Status.DRAFT ) ) , "Cannot insert a published comment into a ChangeDraftUpdate" ) ; com.google.common.base.Preconditions.checkArgument ( ( ! ( changeNotes.containsComment ( c ) ) ) , ( "A comment already exists with the same key," + " so the following comment cannot be inserted: %s" ) , c ) ; upsertComments.add ( c ) ; }

Target:
public void insertComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) throws com.google.gwtorm.server.OrmException { verifyComment ( c ) ; com.google.common.base.Preconditions.checkArgument ( ( ( c.getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.PatchLineComment.Status.DRAFT ) ) , "Cannot insert a published comment into a ChangeDraftUpdate" ) ; if ( migration.readComments ( ) ) { com.google.common.base.Preconditions.checkArgument ( ( ! ( changeNotes.containsComment ( c ) ) ) , ( "A comment already exists with the same key," + " so the following comment cannot be inserted: %s" ) , c ) ; } upsertComments.add ( c ) ; }
Source:
public void testEvictProjectListOK ( ) throws java.lang.Exception { java.lang.String key = "all" ; java.lang.String keyJson = new com.google.gson.GsonBuilder ( ) . create ( ) . toJson ( key ) ; org.mockito.Mockito.when ( httpSessionMock.post ( buildCacheEndpoint ( Constants.PROJECT_LIST ) , keyJson ) ) . thenReturn ( new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarderTest.SUCCESSFUL , com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarderTest.EMPTY_MSG ) ) ; com.google.common.truth.Truth.assertThat ( forwarder.evict ( Constants.PROJECT_LIST , key ) ) . isTrue ( ) ; }

Target:
public void testRemoveToProjectListFailed ( ) throws java.lang.Exception { java.lang.String projectName = "projectToDelete" ; org.mockito.Mockito.when ( httpSessionMock.delete ( buildProjectListCacheEndpoint ( projectName ) ) ) . thenReturn ( new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarderTest.FAILED , com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarderTest.EMPTY_MSG ) ) ; com.google.common.truth.Truth.assertThat ( forwarder.removeFromProjectList ( projectName ) ) . isFalse ( ) ; }
Source:
private static boolean has ( java.lang.Class < ? extends java.lang.annotation.Annotation > annotation , java.lang.Class < ? > clazz ) { BRANCH ( 1.0 ) ; }

Target:
private static boolean has ( java.lang.Class < ? extends java.lang.annotation.Annotation > annotation , java.lang.Class < ? > clazz ) { for ( ; clazz != null ; clazz = clazz.getSuperclass ( ) ) { if ( ( clazz.getAnnotation ( annotation ) ) != null ) { return true ; } } return false ; }
Source:
public org.eclipse.jgit.lib.Config saveGeneralPreferences ( com.google.gerrit.extensions.client.GeneralPreferencesInfo input ) throws org.eclipse.jgit.errors.ConfigInvalidException { input = parse ( input ) ; com.google.gerrit.server.config.ConfigUtil.storeSection ( cfg , UserConfigSections.GENERAL , null , input , com.google.gerrit.server.account.PreferencesConfig.parseDefaultPreferences ( defaultCfg , null ) ) ; com.google.gerrit.server.account.PreferencesConfig.setChangeTable ( cfg , input.changeTable ) ; com.google.gerrit.server.account.PreferencesConfig.setMy ( cfg , input.my ) ; com.google.gerrit.server.account.PreferencesConfig.setUrlAliases ( cfg , input.urlAliases ) ; this . generalPreferences = null ; return cfg ; }

Target:
public com.google.gerrit.extensions.client.DiffPreferencesInfo getDiffPreferences ( ) { if ( ( diffPreferences ) == null ) { parse ( ) ; } return diffPreferences ; }
Source:
public void revokedKeyDueToNoLongerBeingUsedDoesNotRevokeKeyRetroactively ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey k = add ( com.google.gerrit.gpg.testutil.TestKeys.revokedNoLongerUsedKey ( ) ) ; add ( com.google.gerrit.gpg.testutil.TestKeys.validKeyWithoutExpiration ( ) ) ; save ( ) ; assertProblems ( k , "Key is revoked (retired and no longer valid): test7 not used" ) ; com.google.gerrit.gpg.PublicKeyChecker checker = new com.google.gerrit.gpg.PublicKeyChecker ( ) . setStore ( store ) . setEffectiveTime ( com.google.gerrit.gpg.PublicKeyCheckerTest.parseDate ( "2010-01-01 12:00:00 -0400" ) ) ; assertNoProblems ( checker , k ) ; }

Target:
public void revokedKeyDueToNoLongerBeingUsedDoesNotRevokeKeyRetroactively ( ) throws java.lang.Exception { com.google.gerrit.gpg.testing.TestKey k = add ( com.google.gerrit.gpg.testing.TestKeys.revokedNoLongerUsedKey ( ) ) ; add ( com.google.gerrit.gpg.testing.TestKeys.validKeyWithoutExpiration ( ) ) ; save ( ) ; assertProblems ( k , "Key is revoked (retired and no longer valid): test7 not used" ) ; com.google.gerrit.gpg.PublicKeyChecker checker = new com.google.gerrit.gpg.PublicKeyChecker ( ) . setStore ( store ) . setEffectiveTime ( com.google.gerrit.gpg.PublicKeyCheckerTest.parseDate ( "2010-01-01 12:00:00 -0400" ) ) ; assertNoProblems ( checker , k ) ; }
Source:
private boolean isVisibleTo ( com.google.gerrit.reviewdb.Change change , com.google.gerrit.server.IdentifiedUser user ) { final com.google.gerrit.server.project.ProjectState pe = projectCache.get ( change.getProject ( ) ) ; if ( pe == null ) { return false ; } final com.google.gerrit.server.project.ProjectControl pc = pe.controlFor ( user ) ; return pc.controlFor ( change ) . isVisible ( ) ; }

Target:
private boolean isVisibleTo ( com.google.gerrit.reviewdb.Change change , com.google.gerrit.server.IdentifiedUser user , com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.server.project.ProjectState pe = projectCache.get ( change.getProject ( ) ) ; if ( pe == null ) { return false ; } final com.google.gerrit.server.project.ProjectControl pc = pe.controlFor ( user ) ; return pc.controlFor ( change ) . isVisible ( db ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.extensions.config.CapabilityDefinition.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( MonitoringCapability.ID ) ) . to ( com.googlesource.gerrit.plugins.javamelody.MonitoringCapability.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.webui.TopMenu.class ) . to ( com.googlesource.gerrit.plugins.javamelody.MonitoringTopMenu.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.extensions.config.CapabilityDefinition.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( MonitoringCapability.ID ) ) . to ( com.googlesource.gerrit.plugins.javamelody.MonitoringCapability.class ) ; if ( cfg.getBoolean ( "allowTopMenu" , true ) ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.webui.TopMenu.class ) . to ( com.googlesource.gerrit.plugins.javamelody.MonitoringTopMenu.class ) ; } }
Source:
public void onShowView ( ) { super . onShowView ( ) ; if ( prefs.hideTopMenu ( ) ) { com.google.gerrit.client.Gerrit.setHeaderVisible ( false ) ; } int rest = ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + 30 ; cm.setHeight ( ( ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - rest ) ) ; cm.refresh ( ) ; cm.focus ( ) ; }

Target:
public void onResize ( com.google.gwt.event.logical.shared.ResizeEvent event ) { cm.adjustHeight ( header.getOffsetHeight ( ) ) ; }
Source:
private static java.lang.String nameOf ( java.io.File jar ) { java.lang.String name = jar.getName ( ) ; if ( name.endsWith ( ".disabled" ) ) { name = name.substring ( 0 , name.lastIndexOf ( '.' ) ) ; } int ext = name.lastIndexOf ( '.' ) ; return 0 < ext ? name.substring ( 0 , ext ) : name ; }

Target:
private static java.lang.String nameOf ( java.io.File jar ) { return com.google.gerrit.server.plugins.PluginLoader.nameOf ( jar.getName ( ) ) ; }
Source:
public com.gitblit.models.UserModel authenticate ( javax.servlet.http.HttpServletRequest httpRequest ) { java.lang.String gerritUsername = ( ( java.lang.String ) ( httpRequest.getAttribute ( "gerrit-username" ) ) ) ; java.lang.String gerritToken = ( ( java.lang.String ) ( httpRequest.getAttribute ( "gerrit-token" ) ) ) ; if ( ( com.google.common.base.Strings.isNullOrEmpty ( gerritUsername ) ) || ( com.google.common.base.Strings.isNullOrEmpty ( gerritToken ) ) ) { return null ; } httpRequest.getSession ( ) . setAttribute ( Constants.AUTHENTICATION_TYPE , AuthenticationType.CONTAINER ) ; return authenticateSSO ( gerritUsername , gerritToken ) ; }

Target:
public com.gitblit.models.UserModel authenticate ( java.lang.String username ) { return null ; }
Source:
private com.google.gerrit.server.git.MergeOpRepoManager.OpenRepo openRepo ( com.google.gerrit.reviewdb.client.Project.NameKey project ) throws com.google.gerrit.server.git.IntegrationException { try { return orm.openRepo ( project ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException noProject ) { logWarn ( ( ( ( "Project " + ( noProject.project ( ) ) ) + " no longer exists, " ) + "abandoning open changes" ) ) ; abandonAllOpenChangeForDeletedProject ( noProject.project ( ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.IntegrationException ( ( "Error opening project " + project ) , e ) ; } return null ; }

Target:
private com.google.gerrit.server.git.MergeOpRepoManager.OpenRepo openRepo ( com.google.gerrit.reviewdb.client.Project.NameKey project ) throws com.google.gerrit.server.git.IntegrationException { try { return orm.openRepo ( project ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException noProject ) { logWarn ( ( ( "Project " + ( noProject.project ( ) ) ) + " no longer exists, abandoning open changes" ) ) ; abandonAllOpenChangeForDeletedProject ( noProject.project ( ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.IntegrationException ( ( "Error opening project " + project ) , e ) ; } return null ; }
Source:
public java.util.List < com.google.gitiles.BlameCache.Region > load ( com.google.gitiles.BlameCacheImpl.Key key ) throws java.io.IOException { return loadBlame ( key ) ; }

Target:
public static com.google.common.cache.CacheBuilder < com.google.gitiles.BlameCacheImpl.Key , java.util.List < com.google.gitiles.Region > > newBuilder ( ) { return com.google.common.cache.CacheBuilder.newBuilder ( ) . weigher ( new com.google.common.cache.Weigher < com.google.gitiles.BlameCacheImpl.Key , java.util.List < com.google.gitiles.BlameCache.Region > > ( ) { @ java.lang.Override public int weigh ( com.google.gitiles.BlameCacheImpl.Key key , java.util.List < com.google.gitiles.BlameCache.Region > value ) { return value.size ( ) ; } } ) . maximumWeight ( ( 10 << 10 ) ) ; }
Source:
private java.lang.String createDraftChangeWith2PS ( ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , git ) ; com.google.gerrit.acceptance.PushOneCommit.Result result = push.to ( "refs/drafts/master" ) ; push = pushFactory.create ( db , admin.getIdent ( ) , git , PushOneCommit.SUBJECT , "b.txt" , "4711" , result.getChangeId ( ) ) ; return push.to ( "refs/drafts/master" ) . getChangeId ( ) ; }

Target:
private java.lang.String createDraftChangeWith2PS ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo ) ; com.google.gerrit.acceptance.PushOneCommit.Result result = push.to ( "refs/drafts/master" ) ; push = pushFactory.create ( db , admin.getIdent ( ) , testRepo , PushOneCommit.SUBJECT , "b.txt" , "4711" , result.getChangeId ( ) ) ; return push.to ( "refs/drafts/master" ) . getChangeId ( ) ; }
Source:
public void doFilter ( javax.servlet.ServletRequest request , javax.servlet.ServletResponse response , javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { javax.servlet.http.HttpServletRequest req = ( ( javax.servlet.http.HttpServletRequest ) ( request ) ) ; javax.servlet.http.HttpServletResponseWrapper rsp = new javax.servlet.http.HttpServletResponseWrapper ( ( ( javax.servlet.http.HttpServletResponse ) ( response ) ) ) ; if ( verify ( req , rsp ) ) { chain.doFilter ( req , response ) ; } }

Target:
public void doFilter ( javax.servlet.ServletRequest request , javax.servlet.ServletResponse response , javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { javax.servlet.http.HttpServletRequest req = ( ( javax.servlet.http.HttpServletRequest ) ( request ) ) ; if ( ! ( org.eclipse.jgit.http.server.GitSmartHttpTools.isGitClient ( req ) ) ) { chain.doFilter ( request , response ) ; return ; } javax.servlet.http.HttpServletResponseWrapper rsp = new javax.servlet.http.HttpServletResponseWrapper ( ( ( javax.servlet.http.HttpServletResponse ) ( response ) ) ) ; if ( verify ( req , rsp ) ) { chain.doFilter ( req , response ) ; } }
Source:
public void subsetOfBranchesVisibleNotIncludingHead ( ) throws java.lang.Exception { deny ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/master" ) ; allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/branch" ) ; setApiUser ( user ) ; assertRefs ( ( ( r2 ) + "1" ) , ( ( r2 ) + "meta" ) , "refs/heads/branch" , "refs/tags/branch-tag" , "refs/tags/master-tag" ) ; }

Target:
public void uploadPackSubsetOfBranchesVisibleNotIncludingHead ( ) throws java.lang.Exception { deny ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/master" ) ; allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/branch" ) ; setApiUser ( user ) ; assertUploadPackRefs ( ( ( r2 ) + "1" ) , ( ( r2 ) + "meta" ) , "refs/heads/branch" , "refs/tags/branch-tag" , "refs/tags/master-tag" ) ; }
Source:
public static com.google.gerrit.extensions.client.GeneralPreferencesInfo defaults ( ) { com.google.gerrit.extensions.client.GeneralPreferencesInfo p = new com.google.gerrit.extensions.client.GeneralPreferencesInfo ( ) ; p.changesPerPage = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DEFAULT_PAGESIZE ; p.showSiteHeader = true ; p.useFlashClipboard = true ; p.emailStrategy = com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED ; p.emailFormat = com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailFormat.HTML_PLAINTEXT ; p.reviewCategoryStrategy = com.google.gerrit.extensions.client.GeneralPreferencesInfo.ReviewCategoryStrategy.NONE ; p.downloadScheme = null ; p.downloadCommand = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DownloadCommand.CHECKOUT ; p.dateFormat = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DateFormat.STD ; p.timeFormat = com.google.gerrit.extensions.client.GeneralPreferencesInfo.TimeFormat.HHMM_12 ; p.expandInlineDiffs = false ; p.highlightAssigneeInChangeTable = true ; p.relativeDateInChangeTable = false ; p.diffView = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DiffView.SIDE_BY_SIDE ; p.sizeBarInChangeTable = true ; p.legacycidInChangeTable = false ; p.muteCommonPathPrefixes = true ; p.signedOffBy = false ; p.defaultBaseForMerges = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DefaultBase.FIRST_PARENT ; return p ; }

Target:
public static com.google.gerrit.extensions.client.GeneralPreferencesInfo defaults ( ) { com.google.gerrit.extensions.client.GeneralPreferencesInfo p = new com.google.gerrit.extensions.client.GeneralPreferencesInfo ( ) ; p.changesPerPage = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DEFAULT_PAGESIZE ; p.showSiteHeader = true ; p.useFlashClipboard = true ; p.emailStrategy = com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED ; p.emailFormat = com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailFormat.HTML_PLAINTEXT ; p.reviewCategoryStrategy = com.google.gerrit.extensions.client.GeneralPreferencesInfo.ReviewCategoryStrategy.NONE ; p.downloadScheme = null ; p.downloadCommand = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DownloadCommand.CHECKOUT ; p.dateFormat = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DateFormat.STD ; p.timeFormat = com.google.gerrit.extensions.client.GeneralPreferencesInfo.TimeFormat.HHMM_12 ; p.expandInlineDiffs = false ; p.highlightAssigneeInChangeTable = true ; p.relativeDateInChangeTable = false ; p.diffView = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DiffView.SIDE_BY_SIDE ; p.sizeBarInChangeTable = true ; p.legacycidInChangeTable = false ; p.muteCommonPathPrefixes = true ; p.signedOffBy = false ; p.defaultBaseForMerges = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DefaultBase.FIRST_PARENT ; p.publishCommentsOnPush = false ; return p ; }
Source:
public com.google.gerrit.server.patch.PatchList get ( final com.google.gerrit.reviewdb.Change change , final com.google.gerrit.reviewdb.PatchSet patchSet , final com.google.gerrit.reviewdb.AccountDiffPreference.Whitespace whitespace ) { final com.google.gerrit.reviewdb.Project.NameKey projectKey = change.getProject ( ) ; final org.eclipse.jgit.lib.ObjectId a = null ; final org.eclipse.jgit.lib.ObjectId b = org.eclipse.jgit.lib.ObjectId.fromString ( patchSet.getRevision ( ) . get ( ) ) ; return get ( new com.google.gerrit.server.patch.PatchListKey ( projectKey , a , b , whitespace ) ) ; }

Target:
public com.google.gerrit.server.patch.PatchList get ( final com.google.gerrit.reviewdb.Change change , final com.google.gerrit.reviewdb.PatchSet patchSet ) { final com.google.gerrit.reviewdb.Project.NameKey projectKey = change.getProject ( ) ; final org.eclipse.jgit.lib.ObjectId a = null ; final org.eclipse.jgit.lib.ObjectId b = org.eclipse.jgit.lib.ObjectId.fromString ( patchSet.getRevision ( ) . get ( ) ) ; final com.google.gerrit.reviewdb.AccountDiffPreference.Whitespace ws = com.google.gerrit.reviewdb.AccountDiffPreference.Whitespace.IGNORE_NONE ; return get ( new com.google.gerrit.server.patch.PatchListKey ( projectKey , a , b , ws ) ) ; }
Source:
public boolean isValid ( final com.google.gerrit.server.CurrentUser user , final com.google.gerrit.common.data.ApprovalType at , final com.google.gerrit.server.workflow.FunctionState state ) { for ( final com.google.gerrit.reviewdb.ProjectRight pr : state.getAllRights ( at ) ) { if ( ( user.getEffectiveGroups ( ) . contains ( pr.getAccountGroupId ( ) ) ) && ( ( ( pr.getMinValue ( ) ) < 0 ) || ( ( pr.getMaxValue ( ) ) > 0 ) ) ) { return true ; } } return false ; }

Target:
public boolean isValid ( final com.google.gerrit.server.CurrentUser user , final com.google.gerrit.common.data.ApprovalType at , final com.google.gerrit.server.workflow.FunctionState state ) { for ( final com.google.gerrit.reviewdb.RefRight pr : state.getAllRights ( at ) ) { if ( ( user.getEffectiveGroups ( ) . contains ( pr.getAccountGroupId ( ) ) ) && ( ( ( pr.getMinValue ( ) ) < 0 ) || ( ( pr.getMaxValue ( ) ) > 0 ) ) ) { return true ; } } return false ; }
Source:
public void testIndexAndNonIndexPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "status:new bar:p file:a" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.query.change.AndSource.class ) . isSameAs ( out.getClass ( ) ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( com.google.gerrit.server.query.Predicate.and ( in.getChild ( 0 ) , in.getChild ( 2 ) ) ) , in.getChild ( 1 ) ) . inOrder ( ) ; }

Target:
public void testIndexAndNonIndexPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "status:new bar:p file:a" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.query.change.AndChangeSource.class ) . isSameAs ( out.getClass ( ) ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( com.google.gerrit.server.query.Predicate.and ( in.getChild ( 0 ) , in.getChild ( 2 ) ) ) , in.getChild ( 1 ) ) . inOrder ( ) ; }
Source:
public void testUnblockInLocalForceEditTopicName_Fails ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.REGISTERED ) ; assertFalse ( "u can't edit topic name" , u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) ; }

Target:
public void testUnblockForceEditTopicName ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertTrue ( "u can edit topic name" , u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) ; }
Source:
public void generatesExpectedMessage ( ) throws java.lang.Exception { com.cisco.gerrit.plugins.slack.config.ProjectConfig config = getConfig ( ) ; mockEvent.change = com.google.common.base.Suppliers.ofInstance ( mockChange ) ; mockEvent.uploader = com.google.common.base.Suppliers.ofInstance ( mockAccount ) ; mockChange.number = 1234 ; mockChange.project = "testproject" ; mockChange.branch = "master" ; mockChange.url = "https://change/" ; mockChange.commitMessage = "This is a title\nand a the body." ; mockAccount.name = "Unit Tester" ; com.cisco.gerrit.plugins.slack.message.MessageGenerator messageGenerator ; messageGenerator = com.cisco.gerrit.plugins.slack.message.MessageGeneratorFactory.newInstance ( mockEvent , config ) ; java.lang.String expectedResult ; expectedResult = "{\n" + ( ( ( ( ( ( ( ( ( ( ( " \"channel\": \"#testchannel\",\n" + " \"attachments\": [\n" ) + " {\n" ) + " \"fallback\": \"Unit Tester proposed - testproject (master) - https://change/ - This is a title\",\n" ) + " \"pretext\": \"Unit Tester proposed\",\n" ) + " \"title\": \"testproject (master) - change 1234\",\n" ) + " \"title_link\": \"https://change/\",\n" ) + " \"text\": \"This is a title\",\n" ) + " \"color\": \"good\"\n" ) + " }\n" ) + " ]\n" ) + "}\n" ) ; java.lang.String actualResult ; actualResult = messageGenerator.generate ( ) ; org.junit.Assert.assertThat ( actualResult , org.hamcrest.core.Is.is ( org.hamcrest.CoreMatchers.equalTo ( expectedResult ) ) ) ; }

Target:
public void generatesExpectedMessage ( ) throws java.lang.Exception { com.cisco.gerrit.plugins.slack.config.ProjectConfig config = getConfig ( ) ; mockEvent.change = com.google.common.base.Suppliers.ofInstance ( mockChange ) ; mockEvent.uploader = com.google.common.base.Suppliers.ofInstance ( mockAccount ) ; mockChange.number = 1234 ; mockChange.project = "testproject" ; mockChange.branch = "master" ; mockChange.url = "https://change/" ; mockChange.commitMessage = "This is the title\nThis is the message body." ; mockAccount.name = "Unit Tester" ; com.cisco.gerrit.plugins.slack.message.MessageGenerator messageGenerator ; messageGenerator = com.cisco.gerrit.plugins.slack.message.MessageGeneratorFactory.newInstance ( mockEvent , config ) ; java.lang.String expectedResult ; expectedResult = "{\n" + ( ( ( ( ( ( ( ( ( ( ( " \"channel\": \"#testchannel\",\n" + " \"attachments\": [\n" ) + " {\n" ) + " \"fallback\": \"Unit Tester proposed testproject (master) https://change/: This is the title\",\n" ) + " \"pretext\": \"Unit Tester proposed <https://change/|testproject (master) change 1234>\",\n" ) + " \"title\": \"This is the title\",\n" ) + " \"title_link\": \"https://change/\",\n" ) + " \"text\": \"\",\n" ) + " \"color\": \"good\"\n" ) + " }\n" ) + " ]\n" ) + "}\n" ) ; java.lang.String actualResult ; actualResult = messageGenerator.generate ( ) ; org.junit.Assert.assertThat ( actualResult , org.hamcrest.core.Is.is ( org.hamcrest.CoreMatchers.equalTo ( expectedResult ) ) ) ; }
Source:
public void noExternalIds ( ) throws java.lang.Exception { com.google.gerrit.server.account.externalids.ExternalIdsUpdate externalIdsUpdate = externalIdsUpdateFactory.create ( ) ; externalIdsUpdate.deleteAll ( db , user.getAccountId ( ) ) ; reloadUser ( ) ; com.google.gerrit.gpg.testutil.TestKey key = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithSecondUserId ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = checkerFactory.create ( user , store ) . disableTrust ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "No identities found for user; check http://test/#/settings/web-identities" ) ; checker = checkerFactory.create ( ) . setStore ( store ) . disableTrust ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "Key is not associated with any users" ) ; externalIdsUpdate.insert ( db , com.google.gerrit.server.account.externalids.ExternalId.create ( com.google.gerrit.gpg.GerritPublicKeyChecker.toExtIdKey ( key.getPublicKey ( ) ) , user.getAccountId ( ) ) ) ; reloadUser ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "No identities found for user" ) ; }

Target:
public void noExternalIds ( ) throws java.lang.Exception { com.google.gerrit.server.account.externalids.ExternalIdsUpdate externalIdsUpdate = externalIdsUpdateFactory.create ( ) ; externalIdsUpdate.deleteAll ( user.getAccountId ( ) ) ; reloadUser ( ) ; com.google.gerrit.gpg.testutil.TestKey key = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithSecondUserId ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = checkerFactory.create ( user , store ) . disableTrust ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "No identities found for user; check http://test/#/settings/web-identities" ) ; checker = checkerFactory.create ( ) . setStore ( store ) . disableTrust ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "Key is not associated with any users" ) ; externalIdsUpdate.insert ( com.google.gerrit.server.account.externalids.ExternalId.create ( com.google.gerrit.gpg.GerritPublicKeyChecker.toExtIdKey ( key.getPublicKey ( ) ) , user.getAccountId ( ) ) ) ; reloadUser ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "No identities found for user" ) ; }
Source:
protected void setUpEnvironment ( com.google.gerrit.rules.PrologEnvironment env ) { com.google.gerrit.reviewdb.client.Change change = new com.google.gerrit.reviewdb.client.Change ( new com.google.gerrit.reviewdb.client.Change.Key ( "Ibeef" ) , new com.google.gerrit.reviewdb.client.Change.Id ( 1 ) , new com.google.gerrit.reviewdb.client.Account.Id ( 2 ) , new com.google.gerrit.reviewdb.client.Branch.NameKey ( localKey , "refs/heads/master" ) ) ; env.set ( StoredValues.CHANGE , change ) ; env.set ( StoredValues.CHANGE_CONTROL , util.user ( local ) . controlFor ( change ) ) ; }

Target:
protected void setUpEnvironment ( com.google.gerrit.rules.PrologEnvironment env ) { com.google.gerrit.reviewdb.client.Change change = new com.google.gerrit.reviewdb.client.Change ( new com.google.gerrit.reviewdb.client.Change.Key ( "Ibeef" ) , new com.google.gerrit.reviewdb.client.Change.Id ( 1 ) , new com.google.gerrit.reviewdb.client.Account.Id ( 2 ) , new com.google.gerrit.reviewdb.client.Branch.NameKey ( localKey , "refs/heads/master" ) , com.google.gerrit.server.util.TimeUtil.nowTs ( ) ) ; env.set ( StoredValues.CHANGE , change ) ; env.set ( StoredValues.CHANGE_CONTROL , util.user ( local ) . controlFor ( change ) ) ; }
Source:
java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > toFileInfoMap ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.RevId revision , @ com.google.gerrit.common.Nullable com.google.gerrit.reviewdb.client.PatchSet base ) throws com.google.gerrit.server.patch.PatchListNotAvailableException { org.eclipse.jgit.lib.ObjectId a = ( base == null ) ? null : org.eclipse.jgit.lib.ObjectId.fromString ( base.getRevision ( ) . get ( ) ) ; org.eclipse.jgit.lib.ObjectId b = org.eclipse.jgit.lib.ObjectId.fromString ( revision.get ( ) ) ; return toFileInfoMap ( change , a , b ) ; }

Target:
java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > toFileInfoMap ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.RevId revision , @ com.google.gerrit.common.Nullable com.google.gerrit.reviewdb.client.PatchSet base ) throws com.google.gerrit.server.patch.PatchListNotAvailableException { org.eclipse.jgit.lib.ObjectId a = ( base == null ) ? null : org.eclipse.jgit.lib.ObjectId.fromString ( base.getRevision ( ) . get ( ) ) ; org.eclipse.jgit.lib.ObjectId b = org.eclipse.jgit.lib.ObjectId.fromString ( revision.get ( ) ) ; return toFileInfoMap ( change , new com.google.gerrit.server.patch.PatchListKey ( a , b , com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace.IGNORE_NONE ) ) ; }
Source:
public static com.google.gerrit.server.index.IndexConfig fromConfig ( org.eclipse.jgit.lib.Config cfg ) { return com.google.gerrit.server.index.IndexConfig.create ( cfg.getInt ( "index" , null , "maxLimit" , 0 ) , cfg.getInt ( "index" , null , "maxPages" , 0 ) , cfg.getInt ( "index" , null , "maxTerms" , 0 ) ) ; }

Target:
private static void setIfPresent ( org.eclipse.jgit.lib.Config cfg , java.lang.String name , java.util.function.IntConsumer setter ) { int n = cfg.getInt ( "index" , null , name , 0 ) ; if ( n != 0 ) { setter.accept ( n ) ; } }
Source:
public void onFailure ( java.lang.Throwable caught ) { if ( ( ( "default" . equals ( dashboardId ) ) && ( caught instanceof com.google.gwtjsonrpc.client.RemoteJsonException ) ) && ( ( ( ( com.google.gwtjsonrpc.client.RemoteJsonException ) ( caught ) ) . getCode ( ) ) == 404 ) ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChangeQuery ( com.google.gerrit.common.PageLinks.projectQuery ( new com.google.gerrit.reviewdb.client.Project.NameKey ( project ) ) ) ) ; } else { super . onFailure ( caught ) ; } }

Target:
public void onFailure ( java.lang.Throwable caught ) { if ( ( "default" . equals ( dashboardId ) ) && ( com.google.gerrit.client.rpc.RestApi.isNotFound ( caught ) ) ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChangeQuery ( com.google.gerrit.common.PageLinks.projectQuery ( new com.google.gerrit.reviewdb.client.Project.NameKey ( project ) ) ) ) ; } else { super . onFailure ( caught ) ; } }
Source:
public static void deleteChange ( int id , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JavaScriptObject > cb ) { com.google.gerrit.client.changes.ChangeApi.change ( id ) . delete ( cb ) ; }

Target:
public static void publish ( @ com.google.gerrit.common.Nullable java.lang.String project , int id , java.lang.String commit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JavaScriptObject > cb ) { com.google.gwt.core.client.JavaScriptObject in = com.google.gwt.core.client.JavaScriptObject.createObject ( ) ; com.google.gerrit.client.changes.ChangeApi.call ( project , id , commit , "publish" ) . post ( in , cb ) ; }
Source:
private static java.lang.String getValue ( com.google.gerrit.server.git.ProjectConfig cfg , com.google.gerrit.extensions.registration.DynamicMap.Entry < com.google.gerrit.server.config.ProjectConfigEntry > e ) { java.lang.String value = cfg.getPluginConfig ( e.getPluginName ( ) ) . getString ( e.getExportName ( ) ) ; if ( value == null ) { value = e.getProvider ( ) . get ( ) . getDefaultValue ( ) ; } return value ; }

Target:
private static java.lang.String getValue ( com.google.gerrit.server.project.ProjectConfig cfg , com.google.gerrit.extensions.registration.DynamicMap.Entry < com.google.gerrit.server.config.ProjectConfigEntry > e ) { java.lang.String value = cfg.getPluginConfig ( e.getPluginName ( ) ) . getString ( e.getExportName ( ) ) ; if ( value == null ) { value = e.getProvider ( ) . get ( ) . getDefaultValue ( ) ; } return value ; }
Source:
public boolean isEnabled ( com.google.gerrit.server.change.ChangeResource resource ) { return ( resource.getChange ( ) . getStatus ( ) . isOpen ( ) ) && ( resource.getControl ( ) . canAbandon ( ) ) ; }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource resource ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Abandon" ) . setVisible ( ( ( resource.getChange ( ) . getStatus ( ) . isOpen ( ) ) && ( resource.getControl ( ) . canAbandon ( ) ) ) ) ; }
Source:
private java.util.List < com.google.gerrit.reviewdb.RefRight > resolveOwnerGroups ( final java.util.List < com.google.gerrit.reviewdb.RefRight > refRights ) { final java.util.List < com.google.gerrit.reviewdb.RefRight > resolvedRefRights = new java.util.ArrayList < com.google.gerrit.reviewdb.RefRight > ( refRights.size ( ) ) ; for ( final com.google.gerrit.reviewdb.RefRight refRight : refRights ) { resolvedRefRights.addAll ( resolveOwnerGroups ( refRight ) ) ; } return resolvedRefRights ; }

Target:
public int hashCode ( ) { int hc = refPattern.hashCode ( ) ; hc = ( hc * 31 ) + ( permissionName.hashCode ( ) ) ; if ( ( group ) != null ) { hc = ( hc * 31 ) + ( group.hashCode ( ) ) ; } return hc ; }
Source:
private void assertCreateFails ( com.google.gerrit.extensions.api.projects.ProjectInput in , java.lang.Class < ? extends com.google.gerrit.extensions.restapi.RestApiException > errType ) throws java.lang.Exception { try { gApi.projects ( ) . create ( in ) ; org.junit.Assert.fail ( ( "Expected " + ( errType.getSimpleName ( ) ) ) ) ; } catch ( com.google.gerrit.extensions.restapi.RestApiException expected ) { com.google.common.truth.Truth.assertThat ( expected ) . isInstanceOf ( errType ) ; } }

Target:
private void assertCreateFails ( com.google.gerrit.extensions.api.projects.ProjectInput in , java.lang.Class < ? extends com.google.gerrit.extensions.restapi.RestApiException > errType ) throws java.lang.Exception { exception.expect ( errType ) ; gApi.projects ( ) . create ( in ) ; }
Source:
private void setReviewed ( com.google.gerrit.client.diff.FileInfo info , boolean r ) { com.google.gerrit.client.rpc.RestApi api = com.google.gerrit.client.changes.ChangeApi.revision ( curr ) . view ( "files" ) . id ( info.path ( ) ) . view ( "reviewed" ) ; if ( r ) { api.put ( com.google.gerrit.client.rpc.CallbackGroup.< com.google.gerrit.client.changes.ReviewInfo > emptyCallback ( ) ) ; } else { api.delete ( com.google.gerrit.client.rpc.CallbackGroup.< com.google.gerrit.client.changes.ReviewInfo > emptyCallback ( ) ) ; } }

Target:
private void setReviewed ( com.google.gerrit.client.info.FileInfo info , boolean r ) { com.google.gerrit.client.rpc.RestApi api = com.google.gerrit.client.changes.ChangeApi.revision ( curr ) . view ( "files" ) . id ( info.path ( ) ) . view ( "reviewed" ) ; if ( r ) { api.put ( com.google.gerrit.client.rpc.CallbackGroup.< com.google.gerrit.client.changes.ReviewInfo > emptyCallback ( ) ) ; } else { api.delete ( com.google.gerrit.client.rpc.CallbackGroup.< com.google.gerrit.client.changes.ReviewInfo > emptyCallback ( ) ) ; } }
Source:
public int compare ( com.google.gerrit.server.project.ListBranches.BranchInfo a , com.google.gerrit.server.project.ListBranches.BranchInfo b ) { return com.google.common.collect.ComparisonChain.start ( ) . compareTrueFirst ( com.google.gerrit.server.project.ListBranches.BranchComparator.isHead ( a ) , com.google.gerrit.server.project.ListBranches.BranchComparator.isHead ( b ) ) . compareTrueFirst ( com.google.gerrit.server.project.ListBranches.BranchComparator.isConfig ( a ) , com.google.gerrit.server.project.ListBranches.BranchComparator.isConfig ( b ) ) . compare ( a.ref , b.ref ) . result ( ) ; }

Target:
public int compare ( com.google.gerrit.extensions.api.projects.BranchInfo a , com.google.gerrit.extensions.api.projects.BranchInfo b ) { return com.google.common.collect.ComparisonChain.start ( ) . compareTrueFirst ( com.google.gerrit.server.project.ListBranches.BranchComparator.isHead ( a ) , com.google.gerrit.server.project.ListBranches.BranchComparator.isHead ( b ) ) . compareTrueFirst ( com.google.gerrit.server.project.ListBranches.BranchComparator.isConfig ( a ) , com.google.gerrit.server.project.ListBranches.BranchComparator.isConfig ( b ) ) . compare ( a.ref , b.ref ) . result ( ) ; }
Source:
boolean deleteFromIndex ( int changeId ) { try { com.ericsson.gerrit.plugins.multimaster.HttpResponseHandler.HttpResult result = httpSession.delete ( buildEndpoint ( changeId ) ) ; if ( result.isSuccessful ( ) ) { return true ; } com.ericsson.gerrit.plugins.multimaster.RestSession.log.error ( "Unable to delete from index change {}. Cause: {}" , changeId , result.getMessage ( ) ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.multimaster.RestSession.log.error ( ( "Error trying to delete from index change " + changeId ) , e ) ; } return false ; }

Target:
public boolean deleteChangeFromIndex ( int changeId ) { try { com.ericsson.gerrit.plugins.multimaster.HttpResponseHandler.HttpResult result = httpSession.delete ( buildEndpoint ( changeId ) ) ; if ( result.isSuccessful ( ) ) { return true ; } com.ericsson.gerrit.plugins.multimaster.RestEventForwarder.log.error ( "Unable to delete from index change {}. Cause: {}" , changeId , result.getMessage ( ) ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.multimaster.RestEventForwarder.log.error ( ( "Error trying to delete from index change " + changeId ) , e ) ; } return false ; }
Source:
private org.apache.lucene.search.Query or ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p ) throws com.google.gerrit.server.query.QueryParseException { try { org.apache.lucene.search.BooleanQuery q = new org.apache.lucene.search.BooleanQuery ( ) ; for ( int i = 0 ; i < ( p.getChildCount ( ) ) ; i ++ ) { q.add ( toQuery ( p.getChild ( i ) ) , org.apache.lucene.search.BooleanClause.Occur.SHOULD ) ; } return q ; } catch ( org.apache.lucene.search.BooleanQuery e ) { throw new com.google.gerrit.server.query.QueryParseException ( ( "cannot create query for index: " + p ) , e ) ; } }

Target:
private org.apache.lucene.search.Query or ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p ) throws com.google.gerrit.server.query.QueryParseException { try { org.apache.lucene.search.BooleanQuery.Builder q = new org.apache.lucene.search.BooleanQuery.Builder ( ) ; for ( int i = 0 ; i < ( p.getChildCount ( ) ) ; i ++ ) { q.add ( toQuery ( p.getChild ( i ) ) , org.apache.lucene.search.BooleanClause.Occur.SHOULD ) ; } return q.build ( ) ; } catch ( org.apache.lucene.search.BooleanQuery e ) { throw new com.google.gerrit.server.query.QueryParseException ( ( "cannot create query for index: " + p ) , e ) ; } }
Source:
protected void doGet ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { final java.lang.String sid = webSession.get ( ) . getSessionId ( ) ; final com.google.gerrit.server.CurrentUser currentUser = webSession.get ( ) . getCurrentUser ( ) ; final java.lang.String what = "sign out" ; final long when = com.google.gerrit.server.util.TimeUtil.nowMs ( ) ; try { doLogout ( req , rsp ) ; } finally { audit.dispatch ( new com.google.gerrit.audit.AuditEvent ( sid , currentUser , what , when , null , null ) ) ; } }

Target:
protected void doGet ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { final java.lang.String sid = webSession.get ( ) . getSessionId ( ) ; final com.google.gerrit.server.CurrentUser currentUser = webSession.get ( ) . getCurrentUser ( ) ; final java.lang.String what = "sign out" ; final long when = com.google.gerrit.common.TimeUtil.nowMs ( ) ; try { doLogout ( req , rsp ) ; } finally { audit.dispatch ( new com.google.gerrit.audit.AuditEvent ( sid , currentUser , what , when , null , null ) ) ; } }
Source:
public void trustInsufficientDepthInSignature ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey kh = add ( com.google.gerrit.gpg.PublicKeyCheckerTest.keyH ( ) ) ; com.google.gerrit.gpg.testutil.TestKey ki = add ( com.google.gerrit.gpg.PublicKeyCheckerTest.keyI ( ) ) ; add ( com.google.gerrit.gpg.PublicKeyCheckerTest.keyJ ( ) ) ; save ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = newChecker ( 10 , com.google.gerrit.gpg.PublicKeyCheckerTest.keyJ ( ) ) ; assertProblems ( checker , ki ) ; assertProblems ( checker , kh , "No path to a trusted key" , com.google.gerrit.gpg.PublicKeyCheckerTest.notTrusted ( ki ) ) ; }

Target:
public void trustInsufficientDepthInSignature ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey kh = add ( com.google.gerrit.gpg.testutil.TestTrustKeys.keyH ( ) ) ; com.google.gerrit.gpg.testutil.TestKey ki = add ( com.google.gerrit.gpg.testutil.TestTrustKeys.keyI ( ) ) ; add ( com.google.gerrit.gpg.testutil.TestTrustKeys.keyJ ( ) ) ; save ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = newChecker ( 10 , com.google.gerrit.gpg.testutil.TestTrustKeys.keyJ ( ) ) ; assertProblems ( checker , ki ) ; assertProblems ( checker , kh , "No path to a trusted key" , com.google.gerrit.gpg.PublicKeyCheckerTest.notTrusted ( ki ) ) ; }
Source:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change c ) { c.setStatus ( Change.Status.MERGED ) ; c.setMergeable ( true ) ; if ( ! ( merged.equals ( c.currentPatchSetId ( ) ) ) ) { try { c.setCurrentPatchSet ( patchSetInfoFactory.get ( db , merged ) ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e1 ) { com.google.gerrit.server.git.MergeOp.log.error ( ( "Cannot read merged patch set " + merged ) , e1 ) ; } } com.google.gerrit.server.ChangeUtil.updated ( c ) ; return c ; }

Target:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change c ) { c.setStatus ( Change.Status.MERGED ) ; if ( ! ( merged.equals ( c.currentPatchSetId ( ) ) ) ) { try { c.setCurrentPatchSet ( patchSetInfoFactory.get ( db , merged ) ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e1 ) { logError ( ( "Cannot read merged patch set " + merged ) , e1 ) ; } } com.google.gerrit.server.ChangeUtil.updated ( c ) ; return c ; }