auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void listTagsOfNonExistingProjectWithApi ( ) throws java.lang.Exception { exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; gApi.projects ( ) . name ( "does-not-exist" ) . tags ( ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; gApi.projects ( ) . name ( "does-not-exist" ) . tag ( "tag" ) . get ( ) ; }

Target:
public void listTagsOfNonExistingProjectWithApi ( ) throws java.lang.Exception { exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; gApi.projects ( ) . name ( "does-not-exist" ) . tags ( ) . get ( ) ; }
Source:
public void setAssigneeOnReviewableChangeByAdminCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , admin , sc.assignee , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer ) . cc ( admin ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) . to ( sc.assignee ) ; }

Target:
public void setAssigneeOnReviewableChangeByAdminCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , admin , sc.assignee , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer ) . cc ( admin ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . to ( sc.assignee ) ; }
Source:
public static void syncChangeStatus ( final com.google.gerrit.reviewdb.server.ReviewDb db , final com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException { final java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals = db.patchSetApprovals ( ) . byChange ( change.getId ( ) ) . toList ( ) ; for ( com.google.gerrit.reviewdb.client.PatchSetApproval a : approvals ) { a.cache ( change ) ; } db.patchSetApprovals ( ) . update ( approvals ) ; }

Target:
public void syncChangeStatus ( final com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException { final java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals = db.patchSetApprovals ( ) . byChange ( change.getId ( ) ) . toList ( ) ; for ( com.google.gerrit.reviewdb.client.PatchSetApproval a : approvals ) { a.cache ( change ) ; } db.patchSetApprovals ( ) . update ( approvals ) ; }
Source:
private void parseApproval ( com.google.gerrit.reviewdb.client.PatchSet.Id psId , com.google.gerrit.reviewdb.client.Account.Id accountId , java.sql.Timestamp ts , java.lang.String line ) throws org.eclipse.jgit.errors.ConfigInvalidException { if ( accountId == null ) { throw parseException ( "patch set %s requires an identified user as uploader" , psId.get ( ) ) ; } if ( line.startsWith ( "-" ) ) { parseRemoveApproval ( psId , accountId , line ) ; } else { parseAddApproval ( psId , accountId , ts , line ) ; } }

Target:
private void parseApproval ( com.google.gerrit.reviewdb.client.PatchSet.Id psId , com.google.gerrit.reviewdb.client.Account.Id accountId , java.sql.Timestamp ts , java.lang.String line ) throws org.eclipse.jgit.errors.ConfigInvalidException { if ( accountId == null ) { throw parseException ( "patch set %s requires an identified user as uploader" , psId.get ( ) ) ; } if ( line.startsWith ( "-" ) ) { parseRemoveApproval ( psId , accountId , ts , line ) ; } else { parseAddApproval ( psId , accountId , ts , line ) ; } }
Source:
public void testAppend_boolean ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; assertSame ( b , b.append ( true ) ) ; assertSame ( b , b.append ( false ) ) ; assertEquals ( "truefalse" , b.asString ( ) ) ; }

Target:
public void testAppend_boolean ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.append ( true ) ) ; org.junit.Assert.assertSame ( b , b.append ( false ) ) ; org.junit.Assert.assertEquals ( "truefalse" , b.asString ( ) ) ; }
Source:
private static synchronized javax.sql.DataSource newDataSource ( ) throws java.sql.SQLException { final java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , org.h2.Driver.class . getName ( ) ) ; p.setProperty ( "url" , ( ( "jdbc:h2:mem:" + "Test_" ) + ( ++ ( com.google.gerrit.testutil.InMemoryDatabase.dbCnt ) ) ) ) ; final javax.sql.DataSource dataSource = new com.google.gwtorm.jdbc.SimpleDataSource ( p ) ; return dataSource ; }

Target:
private static synchronized javax.sql.DataSource newDataSource ( ) throws java.sql.SQLException { final java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , org.h2.Driver.class . getName ( ) ) ; p.setProperty ( "url" , ( ( "jdbc:h2:mem:" + "Test_" ) + ( ++ ( com.google.gerrit.testutil.InMemoryDatabase.dbCnt ) ) ) ) ; return new com.google.gwtorm.jdbc.SimpleDataSource ( p ) ; }
Source:
private PushOneCommit.Result push ( java.lang.String ref , java.lang.String subject , java.lang.String fileName , java.lang.String content ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , subject , fileName , content ) ; return push.to ( git , ref ) ; }

Target:
private PushOneCommit.Result push ( java.lang.String ref , java.lang.String subject , java.lang.String fileName , java.lang.String content ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , git , subject , fileName , content ) ; return push.to ( ref ) ; }
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.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 ; }
Source:
private static boolean isParentOf ( org.eclipse.jgit.revwalk.RevWalk walk , com.google.gitiles.Revision oldRevision , com.google.gitiles.Revision newRevision ) throws java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { org.eclipse.jgit.revwalk.RevCommit newCommit = walk.parseCommit ( newRevision.getId ( ) ) ; if ( ( newCommit.getParentCount ( ) ) > 0 ) { return java.util.Arrays.asList ( newCommit.getParents ( ) ) . contains ( oldRevision.getId ( ) ) ; } else { return oldRevision == ( Revision.NULL ) ; } }

Target:
private static boolean isParentOf ( org.eclipse.jgit.revwalk.RevWalk walk , com.google.gitiles.Revision oldRevision , com.google.gitiles.Revision newRevision ) throws java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { org.eclipse.jgit.revwalk.RevCommit newCommit = walk.parseCommit ( newRevision.getId ( ) ) ; if ( ( newCommit.getParentCount ( ) ) > 0 ) { return java.util.Arrays.asList ( newCommit.getParents ( ) ) . contains ( oldRevision.getId ( ) ) ; } return oldRevision == ( Revision.NULL ) ; }
Source:
private void savePatchSet ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException { if ( ! ( patchSet.isDraft ( ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "Patch set is not a draft" ) ; } patchSet.setDraft ( false ) ; if ( ! ( wasDraftChange ) ) { com.google.gerrit.server.ChangeUtil.updated ( change ) ; ctx.saveChange ( ) ; } ctx.getDb ( ) . patchSets ( ) . update ( java.util.Collections.singleton ( patchSet ) ) ; }

Target:
private void savePatchSet ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException { if ( ! ( patchSet.isDraft ( ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "Patch set is not a draft" ) ; } patchSet.setDraft ( false ) ; if ( ! ( wasDraftChange ) ) { ctx.saveChange ( ) ; } ctx.getDb ( ) . patchSets ( ) . update ( java.util.Collections.singleton ( patchSet ) ) ; }
Source:
public boolean canForceUpdate ( ) { if ( ! ( canWrite ( ) ) ) { return false ; } if ( canPushWithForce ( ) ) { return true ; } switch ( getUser ( ) . getAccessPath ( ) ) { case GIT : return false ; case JSON_RPC : case REST_API : case SSH_COMMAND : case UNKNOWN : case WEB_BROWSER : default : return ( getUser ( ) . getCapabilities ( ) . isAdmin_DoNotUse ( ) ) || ( ( isOwner ( ) ) && ( ! ( isForceBlocked ( Permission.PUSH ) ) ) ) ; } }

Target:
private boolean canForceUpdate ( ) { if ( ! ( canWrite ( ) ) ) { return false ; } if ( canPushWithForce ( ) ) { return true ; } switch ( getUser ( ) . getAccessPath ( ) ) { case GIT : return false ; case JSON_RPC : case REST_API : case SSH_COMMAND : case UNKNOWN : case WEB_BROWSER : default : return ( getUser ( ) . getCapabilities ( ) . isAdmin_DoNotUse ( ) ) || ( ( isOwner ( ) ) && ( ! ( isForceBlocked ( Permission.PUSH ) ) ) ) ; } }
Source:
private void validateCanReadCommit ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.project.ProjectControl projectControl , org.eclipse.jgit.lib.ObjectId revId ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { org.eclipse.jgit.revwalk.RevCommit commit = rw.parseCommit ( revId ) ; if ( ! ( projectControl.canReadCommit ( db.get ( ) , repo , commit ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } } }

Target:
private void validateCanReadCommit ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.project.ProjectControl projectControl , org.eclipse.jgit.lib.ObjectId revId ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { org.eclipse.jgit.revwalk.RevCommit commit = rw.parseCommit ( revId ) ; if ( ! ( projectControl.canReadCommit ( db.get ( ) , rw , commit ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } } }
Source:
private java.lang.String getHttpBasicAuthenticationHeader ( final javax.servlet.http.HttpServletRequest req ) throws java.io.UnsupportedEncodingException { java.lang.String hdr = req.getHeader ( com.googlesource.gerrit.plugins.github.oauth.OAuthGitFilter.GIT_AUTHORIZATION_HEADER ) ; if ( ( hdr == null ) || ( ! ( hdr.startsWith ( com.googlesource.gerrit.plugins.github.oauth.OAuthGitFilter.GIT_AUTHENTICATION_BASIC ) ) ) ) { return null ; } else { return new java.lang.String ( org.apache.commons.codec.binary.Base64.decodeBase64 ( hdr.substring ( com.googlesource.gerrit.plugins.github.oauth.OAuthGitFilter.GIT_AUTHENTICATION_BASIC.length ( ) ) ) , com.googlesource.gerrit.plugins.github.oauth.OAuthGitFilter.encoding ( req ) ) ; } }

Target:
private java.lang.String getHttpBasicAuthenticationHeader ( final javax.servlet.http.HttpServletRequest req ) throws java.io.UnsupportedEncodingException { java.lang.String hdr = req.getHeader ( com.googlesource.gerrit.plugins.github.oauth.OAuthGitFilter.GIT_AUTHORIZATION_HEADER ) ; if ( ( hdr == null ) || ( ! ( hdr.startsWith ( com.googlesource.gerrit.plugins.github.oauth.OAuthGitFilter.GIT_AUTHENTICATION_BASIC ) ) ) ) { return null ; } return new java.lang.String ( org.apache.commons.codec.binary.Base64.decodeBase64 ( hdr.substring ( com.googlesource.gerrit.plugins.github.oauth.OAuthGitFilter.GIT_AUTHENTICATION_BASIC.length ( ) ) ) , com.googlesource.gerrit.plugins.github.oauth.OAuthGitFilter.encoding ( req ) ) ; }
Source:
public void setAssigneeOnReviewableChangeByOwnerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , sc.owner , sc.assignee , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.reviewer , sc.ccer , sc.starrer ) . cc ( sc.owner ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) . to ( sc.assignee ) ; }

Target:
public void setAssigneeOnReviewableChangeByOwnerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , sc.owner , sc.assignee , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.reviewer , sc.ccer , sc.starrer ) . cc ( sc.owner ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . to ( sc.assignee ) ; }
Source:
private void assertRedirectsTo ( java.lang.String expectedLocation , javax.servlet.http.HttpServletRequest req ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletResponse res = new com.google.gitiles.FakeHttpServletResponse ( ) ; servlet.service ( req , res ) ; assertEquals ( javax.servlet.http.HttpServletResponse.SC_MOVED_PERMANENTLY , res.getStatus ( ) ) ; assertEquals ( expectedLocation , res.getHeader ( com.google.common.net.HttpHeaders.LOCATION ) ) ; }

Target:
private void assertRedirectsTo ( java.lang.String expectedLocation , javax.servlet.http.HttpServletRequest req ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletResponse res = new com.google.gitiles.FakeHttpServletResponse ( ) ; servlet.service ( req , res ) ; org.junit.Assert.assertEquals ( javax.servlet.http.HttpServletResponse.SC_MOVED_PERMANENTLY , res.getStatus ( ) ) ; org.junit.Assert.assertEquals ( expectedLocation , res.getHeader ( com.google.common.net.HttpHeaders.LOCATION ) ) ; }
Source:
protected void bccStarredBy ( ) throws javax.mail.MessagingException { if ( ( db ) != null ) { try { for ( com.google.gerrit.client.reviewdb.StarredChange w : db.starredChanges ( ) . byChange ( change.getId ( ) ) ) { add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } catch ( com.google.gwtorm.client.OrmException err ) { } } }

Target:
protected void bccStarredBy ( ) { if ( ( db ) != null ) { try { for ( com.google.gerrit.client.reviewdb.StarredChange w : db.starredChanges ( ) . byChange ( change.getId ( ) ) ) { add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } catch ( com.google.gwtorm.client.OrmException err ) { } } }
Source:
public static void restore ( int id , java.lang.String msg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.Input input = com.google.gerrit.client.changes.ChangeApi.Input.create ( ) ; input.message ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( msg ) ) ; com.google.gerrit.client.changes.ChangeApi.call ( id , "restore" ) . data ( input ) . post ( cb ) ; }

Target:
public static void restore ( int id , java.lang.String msg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.Input input = com.google.gerrit.client.changes.ChangeApi.Input.create ( ) ; input.message ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( msg ) ) ; com.google.gerrit.client.changes.ChangeApi.call ( id , "restore" ) . post ( input , cb ) ; }
Source:
public com.google.gerrit.server.change.ChangeInserter setStatus ( com.google.gerrit.reviewdb.client.Change.Status status ) { com.google.common.base.Preconditions.checkState ( ( ( change ) == null ) , "setStatus(Change.Status) only valid before creating change" ) ; this . status = status ; if ( Change.Status.DRAFT.equals ( status ) ) { patchSet.setDraft ( true ) ; } return this ; }

Target:
public com.google.gerrit.server.change.ChangeInserter setStatus ( com.google.gerrit.reviewdb.client.Change.Status status ) { com.google.common.base.Preconditions.checkState ( ( ( change ) == null ) , "setStatus(Change.Status) only valid before creating change" ) ; this . status = status ; return this ; }
Source:
void onSave ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { com.google.gerrit.client.changes.ChangeApi.topic ( psId.getParentKey ( ) . get ( ) , input.getValue ( ) . trim ( ) , new com.google.gerrit.client.rpc.GerritCallback < java.lang.String > ( ) { @ java.lang.Override public void onSuccess ( java.lang.String result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( psId ) ) ; } } ) ; onCancel ( null ) ; }

Target:
void onSave ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { com.google.gerrit.client.changes.ChangeApi.topic ( project.get ( ) , psId.getParentKey ( ) . get ( ) , input.getValue ( ) . trim ( ) , new com.google.gerrit.client.rpc.GerritCallback < java.lang.String > ( ) { @ java.lang.Override public void onSuccess ( java.lang.String result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( project , psId ) ) ; } } ) ; onCancel ( null ) ; }
Source:
private void onSend ( ) { final com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > afterSaveDraft = new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { private int done ; @ java.lang.Override public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { if ( ( ++ ( done ) ) == ( commentEditors.size ( ) ) ) { onSend2 ( ) ; } } } ; for ( final com.google.gerrit.client.patches.CommentEditorPanel p : commentEditors ) { p.saveDraft ( afterSaveDraft ) ; } }

Target:
private void onSend ( ) { if ( commentEditors.isEmpty ( ) ) { onSend2 ( ) ; } else { final com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > afterSaveDraft = new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { private int done ; @ java.lang.Override public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { if ( ( ++ ( done ) ) == ( commentEditors.size ( ) ) ) { onSend2 ( ) ; } } } ; for ( final com.google.gerrit.client.patches.CommentEditorPanel p : commentEditors ) { p.saveDraft ( afterSaveDraft ) ; } } }
Source:
public boolean isReviewer ( com.google.gerrit.reviewdb.server.ReviewDb db , @ com.google.gerrit.common.Nullable com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( getUser ( ) . isIdentifiedUser ( ) ) { java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > results = changeData ( db , cd ) . reviewers ( ) . all ( ) ; return results.contains ( getUser ( ) . getAccountId ( ) ) ; } return false ; }

Target:
private boolean isReviewer ( com.google.gerrit.reviewdb.server.ReviewDb db , @ com.google.gerrit.common.Nullable com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( getUser ( ) . isIdentifiedUser ( ) ) { java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > results = changeData ( db , cd ) . reviewers ( ) . all ( ) ; return results.contains ( getUser ( ) . getAccountId ( ) ) ; } return false ; }
Source:
public com.google.gerrit.server.git.ChangeSet completeChangeSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.CurrentUser user ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { com.google.gerrit.server.query.change.ChangeData cd = changeDataFactory.create ( db , change.getProject ( ) , change.getId ( ) ) ; cd.changeControl ( user ) ; if ( com.google.gerrit.server.change.Submit.wholeTopicEnabled ( cfg ) ) { return completeChangeSetIncludingTopics ( db , new com.google.gerrit.server.git.ChangeSet ( cd ) , user ) ; } return completeChangeSetWithoutTopic ( db , new com.google.gerrit.server.git.ChangeSet ( cd ) , user ) ; }

Target:
public com.google.gerrit.server.git.ChangeSet completeChangeSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.CurrentUser user ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { com.google.gerrit.server.query.change.ChangeData cd = changeDataFactory.create ( db , change.getProject ( ) , change.getId ( ) ) ; cd.changeControl ( user ) ; if ( com.google.gerrit.server.change.Submit.wholeTopicEnabled ( cfg ) ) { return completeChangeSetIncludingTopics ( db , new com.google.gerrit.server.git.ChangeSet ( cd , db , null ) , user ) ; } return completeChangeSetWithoutTopic ( db , new com.google.gerrit.server.git.ChangeSet ( cd , db , null ) , user ) ; }
Source:
public void shouldCreateSharedDirectoryIfItDoesNotExist ( ) throws java.lang.Exception { java.io.File configuredDirectory = tempFolder.newFolder ( ) ; com.google.common.truth.Truth.assertThat ( configuredDirectory.delete ( ) ) . isTrue ( ) ; org.mockito.Mockito.when ( configMock.main ( ) . sharedDirectory ( ) ) . thenReturn ( configuredDirectory.getAbsolutePath ( ) ) ; java.nio.file.Path sharedDirectory = module.getSharedDirectory ( configMock ) ; com.google.common.truth.Truth.assertThat ( sharedDirectory.toFile ( ) . exists ( ) ) . isTrue ( ) ; }

Target:
public void shouldCreateSharedDirectoryIfItDoesNotExist ( ) throws java.lang.Exception { java.io.File configuredDirectory = tempFolder.newFolder ( ) ; com.google.common.truth.Truth.assertThat ( configuredDirectory.delete ( ) ) . isTrue ( ) ; org.mockito.Mockito.when ( configMock.main ( ) . sharedDirectory ( ) ) . thenReturn ( configuredDirectory.getAbsolutePath ( ) ) ; java.nio.file.Path sharedDirectory = module.getSharedDirectory ( ) ; com.google.common.truth.Truth.assertThat ( sharedDirectory.toFile ( ) . exists ( ) ) . isTrue ( ) ; }
Source:
public static com.google.gerrit.common.data.PermissionRule grantLabel ( com.google.gerrit.server.git.ProjectConfig project , java.lang.String permissionName , int min , int max , com.google.gerrit.reviewdb.client.AccountGroup.UUID group , java.lang.String ref ) { com.google.gerrit.common.data.PermissionRule rule = com.google.gerrit.server.project.Util.newRule ( project , group ) ; rule.setMin ( min ) ; rule.setMax ( max ) ; return com.google.gerrit.server.project.Util.grant ( project , permissionName , rule , ref ) ; }

Target:
public static com.google.gerrit.common.data.PermissionRule grant ( com.google.gerrit.server.git.ProjectConfig project , java.lang.String permissionName , int min , int max , com.google.gerrit.reviewdb.client.AccountGroup.UUID group , java.lang.String ref ) { com.google.gerrit.common.data.PermissionRule rule = com.google.gerrit.server.project.Util.newRule ( project , group ) ; rule.setMin ( min ) ; rule.setMax ( max ) ; return com.google.gerrit.server.project.Util.grant ( project , permissionName , rule , ref ) ; }
Source:
public void printJson ( final java.lang.StringBuffer sb , final java.sql.Date o ) { if ( o != null ) { sb.append ( '"' ) ; sb.append ( o ) ; sb.append ( '"' ) ; } else { sb.append ( com.google.gwtjsonrpc.client.JS_NULL ) ; } }

Target:
public void printJson ( final java.lang.StringBuffer sb , final java.sql.Date o ) { sb.append ( '"' ) ; sb.append ( o ) ; sb.append ( '"' ) ; }
Source:
private static boolean match ( final java.lang.String a , final java.lang.String ... cases ) { for ( final java.lang.String b : cases ) { if ( org.eclipse.jgit.util.StringUtils.equalsIgnoreCase ( a , b ) ) { return true ; } } return false ; }

Target:
private static boolean match ( final java.lang.String a , final java.lang.String ... cases ) { for ( final java.lang.String b : cases ) { if ( ( b != null ) && ( b.equalsIgnoreCase ( a ) ) ) { return true ; } } return false ; }
Source:
protected boolean shouldSendMessage ( ) { if ( ( body.length ( ) ) == 0 ) { com.google.gerrit.server.mail.OutgoingEmail.log.warn ( "Skipping delivery of email with no body" ) ; return false ; } if ( smtpRcptTo.isEmpty ( ) ) { com.google.gerrit.server.mail.OutgoingEmail.log.info ( "Skipping delivery of email with no recipients" ) ; return false ; } if ( ( ( ( smtpRcptTo.size ( ) ) == 1 ) && ( ( rcptTo.size ( ) ) == 1 ) ) && ( rcptTo.contains ( fromId ) ) ) { return false ; } return true ; }

Target:
protected boolean shouldSendMessage ( ) { if ( ( body.length ( ) ) == 0 ) { return false ; } if ( smtpRcptTo.isEmpty ( ) ) { return false ; } if ( ( ( ( smtpRcptTo.size ( ) ) == 1 ) && ( ( rcptTo.size ( ) ) == 1 ) ) && ( rcptTo.contains ( fromId ) ) ) { return false ; } return true ; }
Source:
public static com.google.gerrit.server.query.change.ChangeData createForTest ( com.google.gerrit.reviewdb.client.Change.Id id , int currentPatchSetId ) { com.google.gerrit.server.query.change.ChangeData cd = new com.google.gerrit.server.query.change.ChangeData ( null , null , null , null , null , null , null , null , null , null , null , null , null , null , id ) ; cd.currentPatchSet = new com.google.gerrit.reviewdb.client.PatchSet ( new com.google.gerrit.reviewdb.client.PatchSet.Id ( id , currentPatchSetId ) ) ; return cd ; }

Target:
public static com.google.gerrit.server.query.change.ChangeData createForTest ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id id , int currentPatchSetId ) { com.google.gerrit.server.query.change.ChangeData cd = new com.google.gerrit.server.query.change.ChangeData ( null , null , null , null , null , null , null , null , null , null , null , null , null , null , project , id ) ; cd.currentPatchSet = new com.google.gerrit.reviewdb.client.PatchSet ( new com.google.gerrit.reviewdb.client.PatchSet.Id ( id , currentPatchSetId ) ) ; return cd ; }
Source:
private void applyRightFloor ( com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.common.data.LabelType lt , com.google.gerrit.reviewdb.client.PatchSetApproval a ) { java.lang.String permission = com.google.gerrit.common.data.Permission.forLabel ( lt.getName ( ) ) ; com.google.gerrit.server.IdentifiedUser user = userFactory.create ( a.getAccountId ( ) ) ; com.google.gerrit.common.data.PermissionRange range = ctl.forUser ( user ) . getRange ( permission ) ; a.setValue ( ( ( short ) ( range.squash ( a.getValue ( ) ) ) ) ) ; }

Target:
private com.google.gerrit.common.data.PermissionRange getRange ( com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.common.data.LabelType lt , com.google.gerrit.reviewdb.client.Account.Id id ) { java.lang.String permission = com.google.gerrit.common.data.Permission.forLabel ( lt.getName ( ) ) ; com.google.gerrit.server.IdentifiedUser user = userFactory.create ( id ) ; return ctl.forUser ( user ) . getRange ( permission ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; index = new com.google.gerrit.server.index.FakeIndex ( FakeIndex.V2 ) ; indexes = new com.google.gerrit.server.index.IndexCollection ( ) ; indexes.setSearchIndex ( index ) ; queryBuilder = new com.google.gerrit.server.index.FakeQueryBuilder ( indexes ) ; rewrite = new com.google.gerrit.server.index.IndexRewriteImpl ( indexes , null , new com.google.gerrit.server.index.IndexRewriteImpl.BasicRewritesImpl ( null ) , new com.google.gerrit.server.query.change.SqlRewriterImpl ( null ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; index = new com.google.gerrit.server.index.FakeIndex ( FakeIndex.V2 ) ; indexes = new com.google.gerrit.server.index.IndexCollection ( ) ; indexes.setSearchIndex ( index ) ; queryBuilder = new com.google.gerrit.server.index.FakeQueryBuilder ( indexes ) ; rewrite = new com.google.gerrit.server.index.IndexRewriteImpl ( indexes , null , new com.google.gerrit.server.index.IndexRewriteImpl.BasicRewritesImpl ( null , indexes ) , new com.google.gerrit.server.query.change.SqlRewriterImpl ( null ) ) ; }
Source:
public org.eclipse.jgit.transport.PushResult to ( java.lang.String ref ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.ssh.GitUtil.add ( git , com.google.gerrit.acceptance.git.ssh.PushForReviewIT.PushOneCommit.FILE_NAME , com.google.gerrit.acceptance.git.ssh.PushForReviewIT.PushOneCommit.FILE_CONTENT ) ; changeId = com.google.gerrit.acceptance.git.ssh.GitUtil.createCommit ( git , sshSession.getIdent ( ) , com.google.gerrit.acceptance.git.ssh.PushForReviewIT.PushOneCommit.SUBJECT ) ; return com.google.gerrit.acceptance.git.ssh.GitUtil.pushHead ( git , ref ) ; }

Target:
public org.eclipse.jgit.transport.PushResult to ( java.lang.String ref ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.ssh.GitUtil.add ( git , com.google.gerrit.acceptance.git.ssh.PushForReviewIT.PushOneCommit.FILE_NAME , com.google.gerrit.acceptance.git.ssh.PushForReviewIT.PushOneCommit.FILE_CONTENT ) ; changeId = com.google.gerrit.acceptance.git.ssh.GitUtil.createCommit ( git , admin.getIdent ( ) , com.google.gerrit.acceptance.git.ssh.PushForReviewIT.PushOneCommit.SUBJECT ) ; return com.google.gerrit.acceptance.git.ssh.GitUtil.pushHead ( git , ref ) ; }
Source:
public void remove ( final com.google.gerrit.reviewdb.client.Project p ) { listLock.lock ( ) ; try { java.util.SortedSet < com.google.gerrit.reviewdb.client.Project.NameKey > n = com.google.common.collect.Sets.newTreeSet ( list.get ( com.google.gerrit.server.project.ProjectCacheImpl.ListKey.ALL ) ) ; n.remove ( p.getNameKey ( ) ) ; list.put ( com.google.gerrit.server.project.ProjectCacheImpl.ListKey.ALL , java.util.Collections.unmodifiableSortedSet ( n ) ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.project.ProjectCacheImpl.log.warn ( "Cannot list avaliable projects" , e ) ; } finally { listLock.unlock ( ) ; } evict ( p ) ; }

Target:
public void remove ( com.google.gerrit.reviewdb.client.Project.NameKey name ) { listLock.lock ( ) ; try { java.util.SortedSet < com.google.gerrit.reviewdb.client.Project.NameKey > n = com.google.common.collect.Sets.newTreeSet ( list.get ( com.google.gerrit.server.project.ProjectCacheImpl.ListKey.ALL ) ) ; n.remove ( name ) ; list.put ( com.google.gerrit.server.project.ProjectCacheImpl.ListKey.ALL , java.util.Collections.unmodifiableSortedSet ( n ) ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.project.ProjectCacheImpl.log.warn ( "Cannot list avaliable projects" , e ) ; } finally { listLock.unlock ( ) ; } evict ( name ) ; }
Source:
public void testChildHashCode ( ) { final long pId = 21281821821821881L ; final long cId = 8 ; final com.google.gwtorm.client.LongKeyTestCase.Parent p = new com.google.gwtorm.client.LongKeyTestCase.Parent ( pId ) ; final com.google.gwtorm.client.LongKeyTestCase.Child c = new com.google.gwtorm.client.LongKeyTestCase.Child ( p , cId ) ; assertSame ( p , c.getParentKey ( ) ) ; assertTrue ( ( cId != ( c.hashCode ( ) ) ) ) ; }

Target:
public void testChildHashCode ( ) { final long pId = 21281821821821881L ; final long cId = 8 ; final com.google.gwtorm.client.LongKeyTestCase.Parent p = new com.google.gwtorm.client.LongKeyTestCase.Parent ( pId ) ; final com.google.gwtorm.client.LongKeyTestCase.Child c = new com.google.gwtorm.client.LongKeyTestCase.Child ( p , cId ) ; org.junit.Assert.assertSame ( p , c.getParentKey ( ) ) ; org.junit.Assert.assertTrue ( ( cId != ( c.hashCode ( ) ) ) ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { com.google.inject.Injector injector = com.google.inject.Guice.createInjector ( new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpClientProviderTest.TestModule ( ) ) ; org.apache.http.impl.client.CloseableHttpClient httpClient1 = injector.getInstance ( org.apache.http.impl.client.CloseableHttpClient.class ) ; com.google.common.truth.Truth.assertThat ( httpClient1 ) . isNotNull ( ) ; org.apache.http.impl.client.CloseableHttpClient httpClient2 = injector.getInstance ( org.apache.http.impl.client.CloseableHttpClient.class ) ; com.google.common.truth.Truth.assertThat ( httpClient1 ) . isEqualTo ( httpClient2 ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { com.google.inject.Injector injector = com.google.inject.Guice.createInjector ( new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpClientProviderTest.TestModule ( ) ) ; try ( org.apache.http.impl.client.CloseableHttpClient httpClient1 = injector.getInstance ( org.apache.http.impl.client.CloseableHttpClient.class ) ) { com.google.common.truth.Truth.assertThat ( httpClient1 ) . isNotNull ( ) ; try ( org.apache.http.impl.client.CloseableHttpClient httpClient2 = injector.getInstance ( org.apache.http.impl.client.CloseableHttpClient.class ) ) { com.google.common.truth.Truth.assertThat ( httpClient1 ) . isEqualTo ( httpClient2 ) ; } } }
Source:
private void setXsrfToken ( ) { com.google.gerrit.client.Gerrit.xGerritAuth = com.google.gwt.user.client.Cookies.getCookie ( com.google.gerrit.common.data.HostPageData.XSRF_COOKIE_NAME ) ; com.google.gwt.user.client.Cookies.removeCookie ( com.google.gerrit.common.data.HostPageData.XSRF_COOKIE_NAME ) ; com.google.gwtjsonrpc.client.JsonUtil.setDefaultXsrfManager ( new com.google.gwtjsonrpc.client.XsrfManager ( ) { @ java.lang.Override public java.lang.String getToken ( com.google.gwtjsonrpc.client.JsonDefTarget proxy ) { return com.google.gerrit.client.Gerrit.xGerritAuth ; } @ java.lang.Override public void setToken ( com.google.gwtjsonrpc.client.JsonDefTarget proxy , java.lang.String token ) { } } ) ; }

Target:
private void setXsrfToken ( ) { com.google.gerrit.client.Gerrit.xGerritAuth = com.google.gwt.user.client.Cookies.getCookie ( com.google.gerrit.common.data.HostPageData.XSRF_COOKIE_NAME ) ; com.google.gwtjsonrpc.client.JsonUtil.setDefaultXsrfManager ( new com.google.gwtjsonrpc.client.XsrfManager ( ) { @ java.lang.Override public java.lang.String getToken ( com.google.gwtjsonrpc.client.JsonDefTarget proxy ) { return com.google.gerrit.client.Gerrit.xGerritAuth ; } @ java.lang.Override public void setToken ( com.google.gwtjsonrpc.client.JsonDefTarget proxy , java.lang.String token ) { } } ) ; }
Source:
public void onLoad ( ) { if ( ( groups ) == null ) { initUI ( ) ; } Util.GROUP_SVC.ownedGroups ( new com.google.gerrit.client.rpc.ScreenLoadCallback < java.util.List < com.google.gerrit.client.reviewdb.AccountGroup > > ( this ) { @ java.lang.Override protected void preDisplay ( final java.util.List < com.google.gerrit.client.reviewdb.AccountGroup > result ) { groups.display ( result ) ; groups.finishDisplay ( true ) ; } } ) ; }

Target:
public void onLoad ( ) { super . onLoad ( ) ; Util.GROUP_SVC.ownedGroups ( new com.google.gerrit.client.rpc.ScreenLoadCallback < java.util.List < com.google.gerrit.client.reviewdb.AccountGroup > > ( this ) { @ java.lang.Override protected void preDisplay ( final java.util.List < com.google.gerrit.client.reviewdb.AccountGroup > result ) { groups.display ( result ) ; groups.finishDisplay ( true ) ; } } ) ; }
Source:
public com.google.gerrit.reviewdb.Change update ( com.google.gerrit.reviewdb.Change c ) { c.setStatus ( Change.Status.MERGED ) ; c.setMergeable ( true ) ; if ( ! ( merged.equals ( c.currentPatchSetId ( ) ) ) ) { try { c.setCurrentPatchSet ( patchSetInfoFactory.get ( 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.Change update ( com.google.gerrit.reviewdb.Change c ) { c.setStatus ( Change.Status.MERGED ) ; c.setMergeable ( true ) ; if ( ! ( merged.equals ( c.currentPatchSetId ( ) ) ) ) { try { c.setCurrentPatchSet ( patchSetInfoFactory.get ( schema , 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 ; }
Source:
public boolean equals ( final java.lang.Object obj ) { if ( ! ( obj instanceof com.google.gerrit.common.data.Permission ) ) { return false ; } final com.google.gerrit.common.data.Permission other = ( ( com.google.gerrit.common.data.Permission ) ( obj ) ) ; if ( ( ! ( name.equals ( other.name ) ) ) || ( ( exclusiveGroup ) != ( other.exclusiveGroup ) ) ) { return false ; } return new java.util.HashSet < com.google.gerrit.common.data.PermissionRule > ( getRules ( ) ) . equals ( new java.util.HashSet < com.google.gerrit.common.data.PermissionRule > ( other.getRules ( ) ) ) ; }

Target:
public boolean equals ( final java.lang.Object obj ) { if ( ! ( obj instanceof com.google.gerrit.common.data.Permission ) ) { return false ; } final com.google.gerrit.common.data.Permission other = ( ( com.google.gerrit.common.data.Permission ) ( obj ) ) ; if ( ( ! ( name.equals ( other.name ) ) ) || ( ( exclusiveGroup ) != ( other.exclusiveGroup ) ) ) { return false ; } return new java.util.HashSet ( getRules ( ) ) . equals ( new java.util.HashSet ( other.getRules ( ) ) ) ; }
Source:
private com.google.gerrit.reviewdb.client.AccountGroup toAccountGroup ( com.google.gson.JsonElement json ) { com.google.gson.JsonElement source = json.getAsJsonObject ( ) . get ( "_source" ) ; if ( source == null ) { source = json.getAsJsonObject ( ) . get ( "fields" ) ; } com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid = new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( source.getAsJsonObject ( ) . get ( GroupField.UUID.getName ( ) ) . getAsString ( ) ) ; return groupCache.get ( uuid ) ; }

Target:
private com.google.gerrit.reviewdb.client.AccountGroup toAccountGroup ( com.google.gson.JsonElement json ) { com.google.gson.JsonElement source = json.getAsJsonObject ( ) . get ( "_source" ) ; if ( source == null ) { source = json.getAsJsonObject ( ) . get ( "fields" ) ; } com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid = new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( source.getAsJsonObject ( ) . get ( GroupField.UUID.getName ( ) ) . getAsString ( ) ) ; return groupCache.get ( ) . get ( uuid ) ; }
Source:
public void testWithoutSymlink ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c = makeCommitWithoutSymlink ( ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = com.googlesource.gerrit.plugins.uploadvalidator.SymlinkValidator.performValidation ( repo , c ) ; com.google.common.truth.Truth.assertThat ( m ) . isEmpty ( ) ; }

Target:
public void testWithoutSymlink ( ) throws java.lang.Exception { try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { org.eclipse.jgit.revwalk.RevCommit c = makeCommitWithoutSymlink ( rw ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = com.googlesource.gerrit.plugins.uploadvalidator.SymlinkValidator.performValidation ( repo , rw.parseCommit ( c ) , rw ) ; com.google.common.truth.Truth.assertThat ( m ) . isEmpty ( ) ; } }
Source:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.Mute.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.StarredChangesUtil.IllegalLabelException , com.google.gwtorm.server.OrmException { if ( ( rsrc.isUserOwner ( ) ) || ( isMuted ( rsrc.getChange ( ) ) ) ) { return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; } stars.mute ( self.get ( ) . getAccountId ( ) , rsrc.getProject ( ) , rsrc.getChange ( ) ) ; return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.Mute.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.StarredChangesUtil.IllegalLabelException , com.google.gwtorm.server.OrmException { if ( ( rsrc.isUserOwner ( ) ) || ( isMuted ( rsrc.getChange ( ) ) ) ) { return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; } stars.mute ( rsrc ) ; return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; }
Source:
private com.google.gerrit.server.project.ProjectState newProjectState ( ) { com.google.gerrit.server.project.ProjectCache projectCache = null ; com.google.gerrit.reviewdb.Project.NameKey wildProject = new com.google.gerrit.reviewdb.Project.NameKey ( "-- All Projects --" ) ; com.google.gerrit.server.project.ProjectControl.AssistedFactory projectControlFactory = null ; com.google.gerrit.reviewdb.Project project = new com.google.gerrit.reviewdb.Project ( ) ; project.setName ( parent.get ( ) ) ; com.google.gerrit.server.project.ProjectState ps = new com.google.gerrit.server.project.ProjectState ( anonymousUser , projectCache , wildProject , projectControlFactory , project , localRights ) ; ps.setInheritedRights ( inheritedRights ) ; 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 = new com.google.gerrit.reviewdb.Project.NameKey ( "-- All Projects --" ) ; com.google.gerrit.server.project.ProjectControl.AssistedFactory projectControlFactory = null ; com.google.gerrit.reviewdb.Project project = new com.google.gerrit.reviewdb.Project ( parent ) ; com.google.gerrit.server.project.ProjectState ps = new com.google.gerrit.server.project.ProjectState ( anonymousUser , projectCache , wildProject , projectControlFactory , project , localRights ) ; ps.setInheritedRights ( inheritedRights ) ; return ps ; }
Source:
public void serverConfigWithPlugin ( ) throws java.lang.Exception { java.nio.file.Path plugins = sitePaths.plugins_dir ; java.nio.file.Files.createDirectory ( plugins ) ; java.nio.file.Path jsplugin = plugins.resolve ( "js-plugin-1.js" ) ; java.nio.file.Files.write ( jsplugin , "Gerrit.install(function(self){});\n" . getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; adminSshSession.exec ( "gerrit plugin reload" ) ; com.google.gerrit.extensions.common.ServerInfo i = gApi.config ( ) . server ( ) . getInfo ( ) ; com.google.common.truth.Truth.assertThat ( i.plugin.jsResourcePaths ) . hasSize ( 1 ) ; }

Target:
public void serverConfigWithPlugin ( ) throws java.lang.Exception { java.nio.file.Path plugins = sitePaths.plugins_dir ; java.nio.file.Path jsplugin = plugins.resolve ( "js-plugin-1.js" ) ; java.nio.file.Files.write ( jsplugin , "Gerrit.install(function(self){});\n" . getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; adminSshSession.exec ( "gerrit plugin reload" ) ; com.google.gerrit.extensions.common.ServerInfo i = gApi.config ( ) . server ( ) . getInfo ( ) ; com.google.common.truth.Truth.assertThat ( i.plugin.jsResourcePaths ) . hasSize ( 1 ) ; }
Source:
public void starUnstarChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; java.lang.String triplet = "p~master~" + ( r.getChangeId ( ) ) ; gApi.accounts ( ) . self ( ) . starChange ( triplet ) ; com.google.common.truth.Truth.assertThat ( getChange ( triplet ) . starred ) . isTrue ( ) ; gApi.accounts ( ) . self ( ) . unstarChange ( triplet ) ; com.google.common.truth.Truth.assertThat ( getChange ( triplet ) . starred ) . isNull ( ) ; }

Target:
public void starUnstarChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; java.lang.String triplet = "p~master~" + ( r.getChangeId ( ) ) ; gApi.accounts ( ) . self ( ) . starChange ( triplet ) ; com.google.common.truth.Truth.assertThat ( info ( triplet ) . starred ) . isTrue ( ) ; gApi.accounts ( ) . self ( ) . unstarChange ( triplet ) ; com.google.common.truth.Truth.assertThat ( info ( triplet ) . starred ) . isNull ( ) ; }
Source:
public com.google.common.util.concurrent.CheckedFuture < ? , java.io.IOException > indexAsync ( java.util.Collection < com.google.gerrit.reviewdb.client.Change.Id > ids ) { java.util.List < com.google.common.util.concurrent.ListenableFuture < ? > > futures = new java.util.ArrayList ( ids.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Change.Id id : ids ) { futures.add ( indexAsync ( id ) ) ; } return com.google.gerrit.server.index.ChangeIndexer.allAsList ( futures ) ; }

Target:
public com.google.common.util.concurrent.CheckedFuture < ? , java.io.IOException > indexAsync ( com.google.gerrit.reviewdb.client.Project.NameKey project , java.util.Collection < com.google.gerrit.reviewdb.client.Change.Id > ids ) { java.util.List < com.google.common.util.concurrent.ListenableFuture < ? > > futures = new java.util.ArrayList ( ids.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Change.Id id : ids ) { futures.add ( indexAsync ( project , id ) ) ; } return com.google.gerrit.server.index.ChangeIndexer.allAsList ( futures ) ; }