auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void deleteVoteFromReviewableWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableWipChange ( ) ; deleteVote ( sc , voter ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . notTo ( voter ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteVoteFromWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; deleteVote ( sc , voter ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) . noOneElse ( ) ; }
Source:
public boolean dryRun ( final com.google.gerrit.server.git.CodeReviewCommit mergeTip , final com.google.gerrit.server.git.CodeReviewCommit toMerge ) throws com.google.gerrit.server.git.MergeException { return ( ! ( com.google.gerrit.server.git.MergeUtil.hasMissingDependencies ( args.mergeSorter , toMerge ) ) ) && ( com.google.gerrit.server.git.MergeUtil.canCherryPick ( args.mergeSorter , args.repo , args.useContentMerge , mergeTip , args.rw , toMerge ) ) ; }

Target:
public boolean dryRun ( final com.google.gerrit.server.git.CodeReviewCommit mergeTip , final com.google.gerrit.server.git.CodeReviewCommit toMerge ) throws com.google.gerrit.server.git.MergeException { return ( ! ( args.mergeUtil.hasMissingDependencies ( args.mergeSorter , toMerge ) ) ) && ( args.mergeUtil.canCherryPick ( args.mergeSorter , args.repo , mergeTip , args.rw , toMerge ) ) ; }
Source:
public static com.google.gerrit.reviewdb.client.AccountDiffPreference createDefault ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.AccountDiffPreference p = new com.google.gerrit.reviewdb.client.AccountDiffPreference ( accountId ) ; p.setIgnoreWhitespace ( com.google.gerrit.reviewdb.client.AccountDiffPreference.Whitespace.IGNORE_NONE ) ; p.setTabSize ( 8 ) ; p.setLineLength ( 100 ) ; p.setSyntaxHighlighting ( true ) ; p.setShowWhitespaceErrors ( true ) ; p.setIntralineDifference ( true ) ; p.setShowTabs ( true ) ; p.setContext ( com.google.gerrit.reviewdb.client.AccountDiffPreference.DEFAULT_CONTEXT ) ; p.setManualReview ( false ) ; return p ; }

Target:
public static com.google.gerrit.reviewdb.client.AccountDiffPreference createDefault ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.AccountDiffPreference p = new com.google.gerrit.reviewdb.client.AccountDiffPreference ( accountId ) ; p.setIgnoreWhitespace ( com.google.gerrit.reviewdb.client.AccountDiffPreference.Whitespace.IGNORE_NONE ) ; p.setTabSize ( 8 ) ; p.setLineLength ( 100 ) ; p.setSyntaxHighlighting ( true ) ; p.setShowWhitespaceErrors ( true ) ; p.setShowLineEndings ( true ) ; p.setIntralineDifference ( true ) ; p.setShowTabs ( true ) ; p.setContext ( com.google.gerrit.reviewdb.client.AccountDiffPreference.DEFAULT_CONTEXT ) ; p.setManualReview ( false ) ; return p ; }
Source:
public void setOriginalSubject ( java.lang.String originalSubject ) { this . originalSubject = originalSubject ; }

Target:
public void setCurrentPatchSet ( com.google.gerrit.reviewdb.client.PatchSet.Id psId , java.lang.String subject , java.lang.String originalSubject ) { if ( ! ( psId.getParentKey ( ) . equals ( changeId ) ) ) { throw new java.lang.IllegalArgumentException ( ( ( ( "patch set ID " + psId ) + " is not for change " ) + ( changeId ) ) ) ; } currentPatchSetId = psId.get ( ) ; this . subject = subject ; this . originalSubject = originalSubject ; }
Source:
public static com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > closed ( ) { java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > r = new java.util.ArrayList < > ( 4 ) ; for ( final com.google.gerrit.reviewdb.client.Change.Status e : Change.Status.values ( ) ) { if ( e.isClosed ( ) ) { r.add ( new com.google.gerrit.server.query.change.ChangeStatusPredicate ( e ) ) ; } } return ( r.size ( ) ) == 1 ? r.get ( 0 ) : or ( r ) ; }

Target:
public static com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > forStatus ( com.google.gerrit.reviewdb.client.Change.Status status ) { return com.google.gerrit.server.query.change.ChangeStatusPredicate.parse ( status.name ( ) ) ; }
Source:
public static void addMember ( com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUUID , java.lang.String member , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.groups.MemberInfo > cb ) { java.lang.String n = com.google.gwt.http.client.URL.encodePathSegment ( member ) ; new com.google.gerrit.client.rpc.RestApi ( ( ( ( com.google.gerrit.client.groups.GroupApi.membersBase ( groupUUID ) ) + "/" ) + n ) ) . put ( cb ) ; }

Target:
public static void addMember ( com.google.gerrit.reviewdb.client.AccountGroup.UUID group , java.lang.String member , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.groups.MemberInfo > cb ) { com.google.gerrit.client.groups.GroupApi.members ( group ) . id ( member ) . put ( cb ) ; }
Source:
private Account.Id parseIdent ( org.eclipse.jgit.revwalk.RevCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { return parseIdent ( commit.getAuthorIdent ( ) ) ; }

Target:
private Account.Id parseIdent ( org.eclipse.jgit.revwalk.RevCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.PersonIdent a = commit.getAuthorIdent ( ) ; org.eclipse.jgit.lib.PersonIdent c = commit.getCommitterIdent ( ) ; if ( ( a.getName ( ) . equals ( c.getName ( ) ) ) && ( a.getEmailAddress ( ) . equals ( c.getEmailAddress ( ) ) ) ) { return null ; } return parseIdent ( commit.getAuthorIdent ( ) ) ; }
Source:
private void expandSideBefore ( int cnt ) { net.codemirror.lib.TextMarker.FromTo range = textMarker.find ( ) ; int oldStart = range.getFrom ( ) . getLine ( ) ; int newStart = oldStart + cnt ; int end = range.getTo ( ) . getLine ( ) ; clearMarkerAndWidget ( ) ; collapse ( newStart , end , true ) ; updateSelection ( ) ; }

Target:
private void expandSideBefore ( int cnt ) { net.codemirror.lib.TextMarker.FromTo range = textMarker.find ( ) ; int oldStart = range.from ( ) . line ( ) ; int newStart = oldStart + cnt ; int end = range.to ( ) . line ( ) ; clearMarkerAndWidget ( ) ; collapse ( newStart , end , true ) ; updateSelection ( ) ; }
Source:
public com.google.gerrit.client.ui.InlineHyperlink getNextPatchLink ( int index , com.google.gerrit.client.patches.PatchScreen.Type patchType ) { for ( index ++ ; index < ( patchList.size ( ) ) ; index ++ ) { com.google.gerrit.client.ui.InlineHyperlink link = createLink ( index , patchType , null , com.google.gwtexpui.safehtml.client.SafeHtml.asis ( Util.C.nextPatchLinkIcon ( ) ) ) ; if ( link != null ) { return link ; } } return null ; }

Target:
public com.google.gerrit.client.ui.InlineHyperlink getNextPatchLink ( int index , com.google.gerrit.client.patches.PatchScreen.Type patchType ) { int nextPatchIndex = getNextPatch ( index , false , PREFERENCE_VALIDATOR ) ; if ( nextPatchIndex < 0 ) { return null ; } com.google.gerrit.client.ui.InlineHyperlink link = createLink ( nextPatchIndex , patchType , null , com.google.gwtexpui.safehtml.client.SafeHtml.asis ( Util.C.nextPatchLinkIcon ( ) ) ) ; return link ; }
Source:
public com.google.gwtjsonrpc.client.VoidResult run ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Account a = db.accounts ( ) . get ( com.google.gerrit.client.rpc.Common.getAccountId ( ) ) ; a.setShowSiteHeader ( newSetting ) ; db.accounts ( ) . update ( java.util.Collections.singleton ( a ) ) ; com.google.gerrit.client.rpc.Common.getAccountCache ( ) . invalidate ( a.getId ( ) ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }

Target:
public com.google.gwtjsonrpc.client.VoidResult run ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gerrit.client.account.Failure , com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Account a = db.accounts ( ) . get ( com.google.gerrit.client.rpc.Common.getAccountId ( ) ) ; if ( a == null ) { throw new com.google.gerrit.client.account.Failure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; } a.setGeneralPreferences ( pref ) ; db.accounts ( ) . update ( java.util.Collections.singleton ( a ) ) ; com.google.gerrit.client.rpc.Common.getAccountCache ( ) . invalidate ( a.getId ( ) ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }
Source:
public static java.lang.String projectQuery ( com.google.gerrit.reviewdb.client.Project.NameKey proj , com.google.gerrit.reviewdb.client.Change.Status status ) { switch ( status ) { case ABANDONED : return "status:abandoned " + ( com.google.gerrit.common.PageLinks.op ( "project" , proj.get ( ) ) ) ; case MERGED : return "status:merged " + ( com.google.gerrit.common.PageLinks.op ( "project" , proj.get ( ) ) ) ; case NEW : case SUBMITTED : default : return "status:open " + ( com.google.gerrit.common.PageLinks.op ( "project" , proj.get ( ) ) ) ; } }

Target:
public static java.lang.String projectQuery ( com.google.gerrit.reviewdb.client.Project.NameKey proj , com.google.gerrit.reviewdb.client.Change.Status status ) { return ( ( com.google.gerrit.common.PageLinks.status ( status ) ) + " " ) + ( com.google.gerrit.common.PageLinks.op ( "project" , proj.get ( ) ) ) ; }
Source:
public void commentOnReviewableChangeByOtherCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.TestAccount other = accounts.create ( "other" , "other@example.com" , "other" ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; setApiUser ( other ) ; review ( sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "comment" , sc ) . to ( sc.owner ) . to ( sc.reviewerByEmail ) . cc ( sc.reviewer , sc.ccer , other ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
private void review ( com.google.gerrit.acceptance.TestAccount account , java.lang.String changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy strategy , @ com.google.gerrit.common.Nullable com.google.gerrit.extensions.api.changes.NotifyHandling notify ) throws java.lang.Exception { setEmailStrategy ( account , strategy ) ; com.google.gerrit.extensions.api.changes.ReviewInput in = com.google.gerrit.extensions.api.changes.ReviewInput.recommend ( ) ; in.notify = notify ; gApi.changes ( ) . id ( changeId ) . revision ( "current" ) . review ( in ) ; }
Source:
private void afterTest ( ) throws java.lang.Exception { db.close ( ) ; sshSession.close ( ) ; if ( ( server ) != ( com.google.gerrit.acceptance.AbstractDaemonTest.commonServer ) ) { server.stop ( ) ; } }

Target:
private void afterTest ( ) throws java.lang.Exception { org.eclipse.jgit.transport.Transport.unregister ( inProcessProtocol ) ; for ( org.eclipse.jgit.lib.Repository repo : toClose ) { repo.close ( ) ; } db.close ( ) ; sshSession.close ( ) ; if ( ( server ) != ( com.google.gerrit.acceptance.AbstractDaemonTest.commonServer ) ) { server.stop ( ) ; } }
Source:
public com.google.gerrit.extensions.client.DiffPreferencesInfo apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { permissionBackend.user ( self ) . check ( GlobalPermission.ADMINISTRATE_SERVER ) ; } com.google.gerrit.reviewdb.client.Account.Id id = rsrc.getUser ( ) . getAccountId ( ) ; return accountCache.get ( id ) . map ( AccountState :: getDiffPreferences ) . orElseThrow ( ( ) -> new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( com.google.gerrit.extensions.restapi.IdString.fromDecoded ( id.toString ( ) ) ) ) ; }

Target:
public com.google.gerrit.extensions.client.DiffPreferencesInfo apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { permissionBackend.currentUser ( ) . check ( GlobalPermission.ADMINISTRATE_SERVER ) ; } com.google.gerrit.reviewdb.client.Account.Id id = rsrc.getUser ( ) . getAccountId ( ) ; return accountCache.get ( id ) . map ( AccountState :: getDiffPreferences ) . orElseThrow ( ( ) -> new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( com.google.gerrit.extensions.restapi.IdString.fromDecoded ( id.toString ( ) ) ) ) ; }
Source:
public boolean isIdentityTrustable ( final java.util.Collection < com.google.gerrit.client.reviewdb.AccountExternalId > ids ) { switch ( getLoginType ( ) ) { case DEVELOPMENT_BECOME_ANY_ACCOUNT : case HTTP : return true ; case OPENID : for ( final com.google.gerrit.client.reviewdb.AccountExternalId e : ids ) { if ( ! ( isTrusted ( e ) ) ) { return false ; } } return true ; default : return false ; } }

Target:
public boolean isIdentityTrustable ( final java.util.Collection < com.google.gerrit.client.reviewdb.AccountExternalId > ids ) { switch ( getLoginType ( ) ) { case DEVELOPMENT_BECOME_ANY_ACCOUNT : case HTTP : case HTTP_LDAP : return true ; case OPENID : for ( final com.google.gerrit.client.reviewdb.AccountExternalId e : ids ) { if ( ! ( isTrusted ( e ) ) ) { return false ; } } return true ; default : return false ; } }
Source:
public java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > addReviewers ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.common.data.LabelTypes labelTypes , com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet ps , com.google.gerrit.reviewdb.client.PatchSetInfo info , java.lang.Iterable < com.google.gerrit.reviewdb.client.Account.Id > wantReviewers , java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > existingReviewers ) throws com.google.gwtorm.server.OrmException { return addReviewers ( db , labelTypes , change , ps.getId ( ) , ps.isDraft ( ) , info.getAuthor ( ) . getAccount ( ) , info.getCommitter ( ) . getAccount ( ) , wantReviewers , existingReviewers ) ; }

Target:
public java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > addReviewers ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.common.data.LabelTypes labelTypes , com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet ps , com.google.gerrit.reviewdb.client.PatchSetInfo info , java.lang.Iterable < com.google.gerrit.reviewdb.client.Account.Id > wantReviewers , java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > existingReviewers ) throws com.google.gwtorm.server.OrmException { return addReviewers ( db , labelTypes , change , ps.getId ( ) , ps.isDraft ( ) , info.getAuthor ( ) . getAccount ( ) , info.getCommitter ( ) . getAccount ( ) , wantReviewers , existingReviewers ) ; }
Source:
public java.util.Map < K , V > getAll ( java.lang.Iterable < K > keys ) { java.util.HashMap < K , V > map = new java.util.HashMap < K , V > ( ) ; for ( K k : keys ) { if ( ! ( map.containsKey ( k ) ) ) { V v = get ( k ) ; if ( v != null ) { map.put ( k , v ) ; } } } return map ; }

Target:
public com.google.common.util.concurrent.ListenableFuture < V > get ( K key ) { return com.google.common.util.concurrent.Futures.compose ( cache.get ( wrapKey ( key ) ) , unpack ) ; }
Source:
public java.lang.Object apply ( com.google.gerrit.server.change.PatchResource resource , com.google.gerrit.server.change.Reviewed.Input input ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.server.ReviewDb db = dbProvider.get ( ) ; com.google.gerrit.reviewdb.client.AccountPatchReview apr = com.google.gerrit.server.change.Reviewed.getExisting ( db , resource ) ; if ( apr != null ) { db.accountPatchReviews ( ) . delete ( java.util.Collections.singleton ( apr ) ) ; } return com.google.gerrit.extensions.restapi.Response.none ( ) ; }

Target:
public java.lang.Object apply ( com.google.gerrit.server.change.FileResource resource , com.google.gerrit.server.change.Reviewed.Input input ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.server.ReviewDb db = dbProvider.get ( ) ; com.google.gerrit.reviewdb.client.AccountPatchReview apr = com.google.gerrit.server.change.Reviewed.getExisting ( db , resource ) ; if ( apr != null ) { db.accountPatchReviews ( ) . delete ( java.util.Collections.singleton ( apr ) ) ; } return com.google.gerrit.extensions.restapi.Response.none ( ) ; }
Source:
public void getGrandChildProject_NotFound ( ) throws java.lang.Exception { com.google.gerrit.acceptance.SshSession sshSession = new com.google.gerrit.acceptance.SshSession ( server , admin ) ; com.google.gerrit.reviewdb.client.Project.NameKey child = new com.google.gerrit.reviewdb.client.Project.NameKey ( "p1" ) ; createProject ( child.get ( ) ) ; com.google.gerrit.reviewdb.client.Project.NameKey grandChild = new com.google.gerrit.reviewdb.client.Project.NameKey ( "p1.1" ) ; createProject ( grandChild.get ( ) , child ) ; sshSession.close ( ) ; assertChildNotFound ( allProjects , grandChild.get ( ) ) ; }

Target:
public void getGrandChildProjectWithRecursiveFlag ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey child = createProject ( "p1" ) ; com.google.gerrit.reviewdb.client.Project.NameKey grandChild = createProject ( "p1.1" , child ) ; com.google.gerrit.extensions.common.ProjectInfo grandChildInfo = gApi.projects ( ) . name ( allProjects.get ( ) ) . child ( grandChild.get ( ) ) . get ( true ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjectInfo ( projectCache.get ( grandChild ) . getProject ( ) , grandChildInfo ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { group1 = group ( "users1" ) ; group ( "users2" ) ; group ( "users3" ) ; user1 = accounts.create ( "user1" , "user1@example.com" , "User1" , "users1" ) ; user2 = accounts.create ( "user2" , "user2@example.com" , "User2" , "users2" ) ; user3 = accounts.create ( "user3" , "user3@example.com" , "User3" , "users1" , "users2" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { group1 = group ( "users1" ) ; group2 = group ( "users2" ) ; group3 = group ( "users3" ) ; user1 = user ( "user1" , group1 ) ; user2 = user ( "user2" , group2 ) ; user3 = user ( "user3" , group1 , group2 ) ; }
Source:
public static void sortRevisionInfoByNumber ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeInfo.RevisionInfo > list ) { java.util.Collections.sort ( com.google.gerrit.client.rpc.Natives.asList ( list ) , new java.util.Comparator < com.google.gerrit.client.changes.ChangeInfo.RevisionInfo > ( ) { @ java.lang.Override public int compare ( com.google.gerrit.client.changes.ChangeInfo.RevisionInfo a , com.google.gerrit.client.changes.ChangeInfo.RevisionInfo b ) { return ( a._number ( ) ) - ( b._number ( ) ) ; } } ) ; }

Target:
private int num ( com.google.gerrit.client.changes.ChangeInfo.RevisionInfo r ) { return ! ( r.is_edit ( ) ) ? ( 2 * ( ( r._number ( ) ) - 1 ) ) + 1 : 2 * editParent ; }
Source:
public boolean canDeleteRef ( final java.lang.String refname ) { switch ( user.getAccessPath ( ) ) { case WEB : if ( isOwner ( ) ) { return true ; } if ( ( com.google.gerrit.server.project.ProjectControl.isHead ( refname ) ) && ( canPerform ( com.google.gerrit.reviewdb.ApprovalCategory.PUSH_HEAD , com.google.gerrit.reviewdb.ApprovalCategory.PUSH_HEAD_REPLACE ) ) ) { return true ; } return false ; case SSH : if ( ( com.google.gerrit.server.project.ProjectControl.isHead ( refname ) ) && ( canPerform ( com.google.gerrit.reviewdb.ApprovalCategory.PUSH_HEAD , com.google.gerrit.reviewdb.ApprovalCategory.PUSH_HEAD_REPLACE ) ) ) { return true ; } return false ; default : return false ; } }

Target:
private boolean canPerformOnAllRefs ( com.google.gerrit.reviewdb.ApprovalCategory.Id actionId , short requireValue ) { return canPerform ( actionId , requireValue , "refs/*" ) ; }
Source:
public com.google.common.collect.ImmutableListMultimap < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSetApproval > getApprovals ( ) { return state.approvals ( ) ; }

Target:
public com.google.common.collect.ImmutableListMultimap < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSetApproval > getApprovals ( ) { if ( ( approvals ) == null ) { com.google.common.collect.ImmutableListMultimap.Builder < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSetApproval > b = com.google.common.collect.ImmutableListMultimap.builder ( ) ; for ( java.util.Map.Entry < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSetApproval > e : state.approvals ( ) ) { b.put ( e.getKey ( ) , new com.google.gerrit.reviewdb.client.PatchSetApproval ( e.getValue ( ) ) ) ; } approvals = b.build ( ) ; } return approvals ; }
Source:
void removeCommentBox ( com.google.gerrit.common.changes.Side side , int line ) { getLineBoxMapFromSide ( side ) . remove ( line ) ; }

Target:
private com.google.gerrit.client.diff.DraftBox addDraftBox ( com.google.gerrit.client.changes.CommentInfo info , boolean doSave ) { com.google.gerrit.client.diff.DraftBox box = new com.google.gerrit.client.diff.DraftBox ( this , revision , info , commentLinkProcessor , true , doSave ) ; addCommentBox ( info , box ) ; if ( ! doSave ) { box.setEdit ( true ) ; } net.codemirror.lib.CodeMirror.LineHandle handle = getCmFromSide ( info.side ( ) ) . getLineHandle ( ( ( info.line ( ) ) - 1 ) ) ; lineActiveBoxMap.put ( handle , box ) ; return box ; }
Source:
private com.google.gerrit.server.account.AccountState toChangeData ( com.google.gson.JsonElement json ) { com.google.gson.JsonElement source = json.getAsJsonObject ( ) . get ( "_source" ) ; if ( source == null ) { source = json.getAsJsonObject ( ) . get ( "fields" ) ; } return toAccountState ( source ) ; }

Target:
private com.google.gerrit.server.account.AccountState toAccountState ( 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.Account.Id id = new com.google.gerrit.reviewdb.client.Account.Id ( source.getAsJsonObject ( ) . get ( com.google.gerrit.server.index.account.AccountField.ID.getName ( ) ) . getAsInt ( ) ) ; return accountCache.get ( id ) ; }
Source:
public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { if ( ( event.isControlKeyDown ( ) ) || ( event.isMetaKeyDown ( ) ) ) { switch ( event.getCharCode ( ) ) { case 'c' : case 'x' : com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.user.client.Command ( ) { public void execute ( ) { hideTextBox ( ) ; } } ) ; break ; } } }

Target:
public void onKeyUp ( final com.google.gwt.event.dom.client.KeyUpEvent event ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.user.client.Command ( ) { public void execute ( ) { hideTextBox ( ) ; } } ) ; }
Source:
private static java.lang.String targetForBrowser ( java.lang.String browser ) { if ( ( browser == null ) || ( browser.isEmpty ( ) ) ) { return "ui_dbg" ; } else if ( browser.startsWith ( "ui_" ) ) { return browser ; } else { return "ui_" + browser ; } }

Target:
private static org.eclipse.jetty.server.ServerConnector newServerConnector ( org.eclipse.jetty.server.Server server , int acceptors , org.eclipse.jetty.server.HttpConfiguration config ) { return new org.eclipse.jetty.server.ServerConnector ( server , null , null , null , 0 , acceptors , new org.eclipse.jetty.server.HttpConnectionFactory ( config ) ) ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { userNameTxt.setEnabled ( true ) ; changeUserName.setEnabled ( true ) ; super . onFailure ( caught ) ; }

Target:
public void onFailure ( final java.lang.Throwable caught ) { userNameTxt.setEnabled ( true ) ; changeUserName.setEnabled ( true ) ; if ( InvalidSshUserNameException.MESSAGE.equals ( caught.getMessage ( ) ) ) { invalidUserName ( ) ; } else { super . onFailure ( caught ) ; } }
Source:
private boolean isRepo ( java.nio.file.Path p ) { java.lang.String name = p.getFileName ( ) . toString ( ) ; return ( ! ( name.equals ( Constants.DOT_GIT ) ) ) && ( name.endsWith ( Constants.DOT_GIT_EXT ) ) ; }

Target:
private boolean isRepo ( java.nio.file.Path p ) { java.lang.String name = p.getFileName ( ) . toString ( ) ; return ( ! ( name.equals ( Constants.DOT_GIT ) ) ) && ( ( name.endsWith ( Constants.DOT_GIT_EXT ) ) || ( org.eclipse.jgit.lib.RepositoryCache.FileKey.isGitRepository ( p.toFile ( ) , FS.DETECTED ) ) ) ; }
Source:
public com.google.common.collect.ImmutableList < com.google.gerrit.reviewdb.client.AccountGroup.UUID > load ( java.lang.String key ) throws java.lang.Exception { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > ids = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.AccountGroupById agi : db.accountGroupById ( ) . all ( ) ) { if ( ! ( com.google.gerrit.reviewdb.client.AccountGroup.isInternalGroup ( agi.getIncludeUUID ( ) ) ) ) { ids.add ( agi.getIncludeUUID ( ) ) ; } } return com.google.common.collect.ImmutableList.copyOf ( ids ) ; } }

Target:
public com.google.common.collect.ImmutableList < com.google.gerrit.reviewdb.client.AccountGroup.UUID > load ( java.lang.String key ) throws java.lang.Exception { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { return groups.getExternalGroups ( db ) . collect ( com.google.common.collect.ImmutableList.toImmutableList ( ) ) ; } }
Source:
private void throwUnsupported ( final org.objectweb.asm.MethodVisitor mv , final java.lang.String message ) { final org.objectweb.asm.Type eType = org.objectweb.asm.Type.getType ( java.lang.UnsupportedOperationException.class ) ; mv.visitTypeInsn ( com.google.gwtorm.jdbc.gen.NEW , eType.getInternalName ( ) ) ; mv.visitInsn ( com.google.gwtorm.jdbc.gen.DUP ) ; mv.visitLdcInsn ( message ) ; mv.visitMethodInsn ( com.google.gwtorm.jdbc.gen.INVOKESPECIAL , eType.getInternalName ( ) , "<init>" , org.objectweb.asm.Type.getMethodDescriptor ( Type.VOID_TYPE , new org.objectweb.asm.Type [ ] { org.objectweb.asm.Type.getType ( java.lang.String.class ) } ) ) ; mv.visitInsn ( com.google.gwtorm.jdbc.gen.ATHROW ) ; }

Target:
private void throwUnsupported ( final org.objectweb.asm.MethodVisitor mv , final java.lang.String message ) { final org.objectweb.asm.Type eType = org.objectweb.asm.Type.getType ( java.lang.UnsupportedOperationException.class ) ; mv.visitTypeInsn ( com.google.gwtorm.jdbc.NEW , eType.getInternalName ( ) ) ; mv.visitInsn ( com.google.gwtorm.jdbc.DUP ) ; mv.visitLdcInsn ( message ) ; mv.visitMethodInsn ( com.google.gwtorm.jdbc.INVOKESPECIAL , eType.getInternalName ( ) , "<init>" , org.objectweb.asm.Type.getMethodDescriptor ( Type.VOID_TYPE , new org.objectweb.asm.Type [ ] { org.objectweb.asm.Type.getType ( java.lang.String.class ) } ) ) ; mv.visitInsn ( com.google.gwtorm.jdbc.ATHROW ) ; }
Source:
private void assertReviewers ( com.google.gerrit.reviewdb.client.Change c , com.google.gerrit.acceptance.TestAccount ... expectedReviewers ) throws com.google.gwtorm.server.OrmException { java.lang.Iterable < com.google.gerrit.reviewdb.client.Account.Id > actualIds = approvalsUtil.getReviewers ( db , notesFactory.create ( db , c.getProject ( ) , c.getId ( ) ) ) . values ( ) ; com.google.common.truth.Truth.assertThat ( actualIds ) . containsExactlyElementsIn ( com.google.common.collect.Sets.newHashSet ( com.google.gerrit.acceptance.TestAccount.ids ( expectedReviewers ) ) ) ; }

Target:
private void assertReviewers ( com.google.gerrit.reviewdb.client.Change c , com.google.gerrit.acceptance.TestAccount ... expectedReviewers ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { java.lang.Iterable < com.google.gerrit.reviewdb.client.Account.Id > actualIds = approvalsUtil.getReviewers ( db , notesFactory.createChecked ( db , c ) ) . values ( ) ; com.google.common.truth.Truth.assertThat ( actualIds ) . containsExactlyElementsIn ( com.google.common.collect.Sets.newHashSet ( com.google.gerrit.acceptance.TestAccount.ids ( expectedReviewers ) ) ) ; }
Source:
public static void toggleStar ( final com.google.gerrit.reviewdb.client.Change.Id changeId , final boolean newValue ) { if ( ( com.google.gerrit.client.changes.StarredChanges.next ) == null ) { com.google.gerrit.client.changes.StarredChanges.next = new com.google.gerrit.common.data.ToggleStarRequest ( ) ; } com.google.gerrit.client.changes.StarredChanges.next.toggle ( changeId , newValue ) ; com.google.gerrit.client.changes.StarredChanges.fireChangeStarEvent ( changeId , newValue ) ; if ( ! ( com.google.gerrit.client.changes.StarredChanges.busy ) ) { com.google.gerrit.client.changes.StarredChanges.start ( ) ; } }

Target:
public static void toggleStar ( final com.google.gerrit.reviewdb.client.Change.Id changeId , final boolean newValue ) { com.google.gerrit.client.changes.StarredChanges.pending.put ( changeId , newValue ) ; com.google.gerrit.client.changes.StarredChanges.fireChangeStarEvent ( changeId , newValue ) ; if ( ! ( com.google.gerrit.client.changes.StarredChanges.busy ) ) { com.google.gerrit.client.changes.StarredChanges.startRequest ( ) ; } }
Source:
private static boolean getBoolean ( org.eclipse.jgit.lib.Config cfg , java.lang.String section , java.lang.String name , boolean defaultValue ) { try { return cfg.getBoolean ( section , name , defaultValue ) ; } catch ( java.lang.IllegalArgumentException e ) { com.ericsson.gerrit.plugins.highavailability.Configuration.log.error ( java.lang.String.format ( "invalid value for %s; using default value %s" , name , defaultValue ) ) ; com.ericsson.gerrit.plugins.highavailability.Configuration.log.debug ( ( "Failed to retrieve boolean value: " + ( e.getMessage ( ) ) ) , e ) ; return defaultValue ; } }

Target:
private static boolean getBoolean ( org.eclipse.jgit.lib.Config cfg , java.lang.String section , java.lang.String name , boolean defaultValue ) { try { return cfg.getBoolean ( section , name , defaultValue ) ; } catch ( java.lang.IllegalArgumentException e ) { com.ericsson.gerrit.plugins.highavailability.Configuration.log.error ( "invalid value for {}; using default value {}" , name , defaultValue ) ; com.ericsson.gerrit.plugins.highavailability.Configuration.log.debug ( "Failed to retrieve boolean value: {}" , e.getMessage ( ) , e ) ; return defaultValue ; } }
Source:
public void onOk ( ) { send ( ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.rpc.NativeString msg ) { setEnabled ( true ) ; if ( ( msg != null ) && ( ! ( msg.asString ( ) . isEmpty ( ) ) ) ) { com.google.gwt.user.client.Window.alert ( msg.asString ( ) ) ; } com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange2 ( changeId ) ) ; }
Source:
private boolean isActionAllowed ( com.google.gerrit.server.project.ChangeControl changeControl , com.google.gerrit.reviewdb.client.Change.Status status ) { return ( ( status != ( com.google.gerrit.reviewdb.client.Change.Status.DRAFT ) ) || ( allowDrafts ) ) || ( changeControl.isAdmin ( ) ) ; }

Target:
private boolean couldDeleteWhenIn ( com.google.gerrit.reviewdb.client.Change.Status status ) { switch ( status ) { case NEW : case ABANDONED : return true ; case MERGED : return false ; case DRAFT : if ( allowDrafts ) { return true ; } return permissionBackend.user ( user ) . testOrFalse ( GlobalPermission.ADMINISTRATE_SERVER ) ; } return false ; }
Source:
public static java.util.Set < java.lang.String > accountFields ( com.google.gerrit.server.index.QueryOptions opts ) { java.util.Set < java.lang.String > fs = opts.fields ( ) ; return fs.contains ( com.google.gerrit.server.index.account.AccountField.ID.getName ( ) ) ? fs : com.google.common.collect.Sets.union ( fs , com.google.common.collect.ImmutableSet.of ( com.google.gerrit.server.index.account.AccountField.ID.getName ( ) ) ) ; }

Target:
public static java.util.Set < java.lang.String > accountFields ( com.google.gerrit.server.index.QueryOptions opts ) { java.util.Set < java.lang.String > fs = opts.fields ( ) ; return fs.contains ( AccountField.ID.getName ( ) ) ? fs : com.google.common.collect.Sets.union ( fs , com.google.common.collect.ImmutableSet.of ( AccountField.ID.getName ( ) ) ) ; }
Source:
private void index ( com.google.gerrit.reviewdb.client.Account.Id id ) throws java.io.IOException { java.util.concurrent.atomic.AtomicInteger accountIdLock = getAndIncrementAccountIdLock ( id ) ; synchronized ( accountIdLock ) { indexer.index ( id ) ; com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexAccountRestApiServlet.logger.debug ( "Account successfully indexed" , id ) ; } if ( ( accountIdLock.decrementAndGet ( ) ) == 0 ) { removeAccountIdLock ( id ) ; } }

Target:
void index ( com.google.gerrit.reviewdb.client.Account.Id id , com.ericsson.gerrit.plugins.highavailability.forwarder.rest.Operation operation ) throws java.io.IOException { indexer.index ( id ) ; com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexAccountRestApiServlet.logger.debug ( "Account successfully indexed" , id ) ; }
Source:
private com.google.gerrit.httpd.resources.Resource getMarkdownAsHtmlResource ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig cfg , com.google.gerrit.reviewdb.client.Project.NameKey project , java.lang.String md , int lastModified ) throws java.io.IOException { com.google.gerrit.server.documentation.MarkdownFormatter f = new com.google.gerrit.server.documentation.MarkdownFormatter ( ) ; if ( ! ( cfg.isHtmlAllowed ( Formatter.MARKDOWN ) ) ) { f.suppressHtml ( ) ; } byte [ ] html = f.markdownToDocHtml ( replaceMacros ( project , md ) , java.nio.charset.StandardCharsets.UTF_8.name ( ) ) ; return new com.google.gerrit.httpd.resources.SmallResource ( html ) . setContentType ( "text/html" ) . setCharacterEncoding ( java.nio.charset.StandardCharsets.UTF_8.name ( ) ) . setLastModified ( lastModified ) ; }

Target:
private byte [ ] formatMarkdownAsHtml ( com.googlesource.gerrit.plugins.xdocs.XDocGlobalConfig cfg , java.lang.String md ) throws java.io.IOException { com.google.gerrit.server.documentation.MarkdownFormatter f = new com.google.gerrit.server.documentation.MarkdownFormatter ( ) ; if ( ! ( cfg.isHtmlAllowed ( Formatter.MARKDOWN ) ) ) { f.suppressHtml ( ) ; } return f.markdownToDocHtml ( md , java.nio.charset.StandardCharsets.UTF_8.name ( ) ) ; }
Source:
protected void configure ( ) { bind ( java.util.concurrent.Executor.class ) . annotatedWith ( com.googlesource.gerrit.plugins.webhooks.WebHooksExecutor.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.ExecutorProvider.class ) ; bind ( com.googlesource.gerrit.plugins.webhooks.Configuration.class ) . in ( Scopes.SINGLETON ) ; bind ( org.apache.http.impl.client.CloseableHttpClient.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.HttpClientProvider.class ) . in ( Scopes.SINGLETON ) ; factory ( PostEventTask.Factory.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.EventListener.class ) . to ( com.googlesource.gerrit.plugins.webhooks.EventHandler.class ) ; }

Target:
protected void configure ( ) { bind ( java.util.concurrent.ScheduledThreadPoolExecutor.class ) . annotatedWith ( com.googlesource.gerrit.plugins.webhooks.WebHooksExecutor.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.ExecutorProvider.class ) ; bind ( com.googlesource.gerrit.plugins.webhooks.Configuration.class ) . in ( Scopes.SINGLETON ) ; bind ( org.apache.http.impl.client.CloseableHttpClient.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.HttpClientProvider.class ) . in ( Scopes.SINGLETON ) ; factory ( PostTask.Factory.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.EventListener.class ) . to ( com.googlesource.gerrit.plugins.webhooks.EventHandler.class ) ; }
Source:
public final boolean has_skip ( ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.diff.DiffInfo.Region > c = content ( ) ; for ( int i = 0 ; i < ( c.length ( ) ) ; i ++ ) { if ( ( c.get ( i ) . skip ( ) ) != 0 ) { return true ; } } return false ; }

Target:
public final boolean hasSkip ( ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.diff.DiffInfo.Region > c = content ( ) ; for ( int i = 0 ; i < ( c.length ( ) ) ; i ++ ) { if ( ( c.get ( i ) . skip ( ) ) != 0 ) { return true ; } } return false ; }
Source:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.ChangeInfo > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.extensions.api.changes.FixInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException { if ( ( ! ( rsrc.isUserOwner ( ) ) ) && ( ! ( rsrc.getControl ( ) . getProjectControl ( ) . isOwner ( ) ) ) ) { permissionBackend.user ( user ) . check ( GlobalPermission.MAINTAIN_SERVER ) ; } return com.google.gerrit.extensions.restapi.Response.withMustRevalidate ( newChangeJson ( ) . fix ( input ) . format ( rsrc ) ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.ChangeInfo > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.extensions.api.changes.FixInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.NoSuchProjectException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( ( ! ( rsrc.isUserOwner ( ) ) ) && ( ! ( projectControlFactory.controlFor ( rsrc.getProject ( ) , rsrc.getUser ( ) ) . isOwner ( ) ) ) ) { permissionBackend.user ( user ) . check ( GlobalPermission.MAINTAIN_SERVER ) ; } return com.google.gerrit.extensions.restapi.Response.withMustRevalidate ( newChangeJson ( ) . fix ( input ) . format ( rsrc ) ) ; }
Source:
private org.eclipse.jgit.revwalk.RevObject resolve ( java.lang.String name , org.eclipse.jgit.revwalk.RevWalk walk ) throws java.io.IOException { try { org.eclipse.jgit.lib.ObjectId id = repo.resolve ( name ) ; return id != null ? walk.parseAny ( id ) : null ; } catch ( org.eclipse.jgit.errors.RevisionSyntaxException e ) { return null ; } catch ( org.eclipse.jgit.errors.MissingObjectException e ) { return null ; } }

Target:
private org.eclipse.jgit.revwalk.RevObject resolve ( java.lang.String name , org.eclipse.jgit.revwalk.RevWalk walk ) throws java.io.IOException { try { org.eclipse.jgit.lib.ObjectId id = repo.resolve ( name ) ; return id != null ? walk.parseAny ( id ) : null ; } catch ( org.eclipse.jgit.errors.AmbiguousObjectException e ) { return null ; } catch ( org.eclipse.jgit.errors.RevisionSyntaxException e ) { return null ; } catch ( org.eclipse.jgit.errors.MissingObjectException e ) { return null ; } }
Source:
private com.google.gerrit.server.notedb.RevisionNoteData parseJson ( com.google.gerrit.server.notedb.ChangeNoteUtil noteUtil , int offset ) throws java.io.IOException { com.google.gerrit.server.notedb.RevisionNoteData data ; try ( java.io.InputStream is = new java.io.ByteArrayInputStream ( raw , offset , ( ( raw.length ) - offset ) ) ; java.io.Reader r = new java.io.InputStreamReader ( is ) ) { data = noteUtil.getGson ( ) . fromJson ( r , com.google.gerrit.server.notedb.RevisionNoteData.class ) ; } return data ; }

Target:
protected void checkParsed ( ) { com.google.common.base.Preconditions.checkState ( ( ( raw ) != null ) , "revision note not parsed yet" ) ; }
Source:
public void missingRepo ( ) throws java.lang.Exception { assumeNoteDbDisabled ( ) ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey name = ctl.getProject ( ) . getNameKey ( ) ; ( ( com.google.gerrit.testutil.InMemoryRepositoryManager ) ( repoManager ) ) . deleteRepository ( name ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Destination repository not found: " + name ) ) ) ; }

Target:
public void missingRepo ( ) throws java.lang.Exception { assumeNoteDbDisabled ( ) ; com.google.gerrit.server.notedb.ChangeNotes notes = insertChange ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey name = notes.getProjectName ( ) ; com.google.gerrit.server.project.ChangeControl ctl = controlForNotes ( notes ) ; ( ( com.google.gerrit.testutil.InMemoryRepositoryManager ) ( repoManager ) ) . deleteRepository ( name ) ; com.google.common.truth.Truth.assertThat ( checker.check ( ctl , null ) . problems ( ) ) . containsExactly ( com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Destination repository not found: " + name ) ) ) ; }
Source:
public void parseRef ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit master = repo.branch ( "refs/heads/master" ) . commit ( ) . create ( ) ; org.junit.Assert.assertEquals ( new com.google.gitiles.RevisionParser.Result ( com.google.gitiles.Revision.peeled ( "master" , master ) ) , parser.parse ( "master" ) ) ; org.junit.Assert.assertEquals ( new com.google.gitiles.RevisionParser.Result ( com.google.gitiles.Revision.peeled ( "refs/heads/master" , master ) ) , parser.parse ( "refs/heads/master" ) ) ; org.junit.Assert.assertNull ( parser.parse ( "refs//heads//master" ) ) ; org.junit.Assert.assertNull ( parser.parse ( "refs heads master" ) ) ; }

Target:
public void parseRef ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit master = repo.branch ( "refs/heads/master" ) . commit ( ) . create ( ) ; com.google.common.truth.Truth.assertThat ( parser.parse ( "master" ) ) . isEqualTo ( new com.google.gitiles.RevisionParser.Result ( com.google.gitiles.Revision.peeled ( "master" , master ) ) ) ; com.google.common.truth.Truth.assertThat ( parser.parse ( "refs/heads/master" ) ) . isEqualTo ( new com.google.gitiles.RevisionParser.Result ( com.google.gitiles.Revision.peeled ( "refs/heads/master" , master ) ) ) ; com.google.common.truth.Truth.assertThat ( parser.parse ( "refs//heads//master" ) ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( parser.parse ( "refs heads master" ) ) . isNull ( ) ; }
Source:
public com.google.gerrit.server.change.ChangeJson.ChangeInfo format ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.query.change.ChangeData cd = new com.google.gerrit.server.query.change.ChangeData ( rsrc.getControl ( ) ) ; cd.limitToPatchSets ( com.google.common.collect.ImmutableList.of ( rsrc.getPatchSet ( ) . getId ( ) ) ) ; return format ( cd ) ; }

Target:
public com.google.gerrit.server.change.ChangeJson.ChangeInfo format ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.query.change.ChangeData cd = changeDataFactory.create ( db.get ( ) , rsrc.getControl ( ) ) ; cd.limitToPatchSets ( com.google.common.collect.ImmutableList.of ( rsrc.getPatchSet ( ) . getId ( ) ) ) ; return format ( cd ) ; }
Source:
public void newPatchSetByOtherOnReviewableChangeOwnerSelfCcInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master" , other , EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.owner , sc.reviewer , other ) . cc ( sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetByOtherOnReviewableChangeOwnerSelfCcInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; pushTo ( sc , "refs/for/master" , other , EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.owner , sc.reviewer , other ) . cc ( sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) . noOneElse ( ) ; }
Source:
public static org.eclipse.jgit.lib.Config allEnabledConfig ( ) { org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; for ( com.google.gerrit.server.notedb.ConfigNotesMigration.Table t : com.google.gerrit.server.notedb.ConfigNotesMigration.Table.values ( ) ) { cfg.setBoolean ( com.google.gerrit.server.notedb.ConfigNotesMigration.NOTEDB , t.key ( ) , com.google.gerrit.server.notedb.ConfigNotesMigration.WRITE , true ) ; cfg.setBoolean ( com.google.gerrit.server.notedb.ConfigNotesMigration.NOTEDB , t.key ( ) , com.google.gerrit.server.notedb.ConfigNotesMigration.READ , true ) ; } return cfg ; }

Target:
public static org.eclipse.jgit.lib.Config allEnabledConfig ( ) { org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; for ( com.google.gerrit.server.notedb.NoteDbTable t : com.google.gerrit.server.notedb.NoteDbTable.values ( ) ) { cfg.setBoolean ( com.google.gerrit.server.notedb.ConfigNotesMigration.NOTE_DB , t.key ( ) , com.google.gerrit.server.notedb.ConfigNotesMigration.WRITE , true ) ; cfg.setBoolean ( com.google.gerrit.server.notedb.ConfigNotesMigration.NOTE_DB , t.key ( ) , com.google.gerrit.server.notedb.ConfigNotesMigration.READ , true ) ; } return cfg ; }
Source:
private void testPushWithInvalidChangeIdFromEgit ( ) throws java.lang.Exception { com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , ( "Message with invalid Change-Id\n" + ( "\n" + "Change-Id: I0000000000000000000000000000000000000000\n" ) ) ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; com.google.gerrit.server.git.ProjectConfig config = projectCache.checkedGet ( project ) . getConfig ( ) ; config.getProject ( ) . setRequireChangeID ( InheritableBoolean.FALSE ) ; saveProjectConfig ( project , config ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; }

Target:
private void testPushWithMultipleChangeIds ( ) throws java.lang.Exception { com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , ( "Message with multiple Change-Id\n" + ( ( "\n" + "Change-Id: I10f98c2ef76e52e23aa23be5afeb71e40b350e86\n" ) + "Change-Id: Ie9a132e107def33bdd513b7854b50de911edba0a\n" ) ) ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "multiple Change-Id lines in commit message footer" ) ; setRequireChangeId ( InheritableBoolean.FALSE ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "multiple Change-Id lines in commit message footer" ) ; }
Source:
public void run ( ) { getSkipManager ( ) . removeAll ( ) ; getChunkManager ( ) . reset ( ) ; getDiffTable ( ) . scrollbar.removeDiffAnnotations ( ) ; setShowIntraline ( prefs.intralineDifference ( ) ) ; render ( diff ) ; getSkipManager ( ) . render ( prefs.context ( ) , diff ) ; }

Target:
public void run ( ) { skipManager.removeAll ( ) ; getChunkManager ( ) . reset ( ) ; getDiffTable ( ) . scrollbar.removeDiffAnnotations ( ) ; setShowIntraline ( prefs.intralineDifference ( ) ) ; render ( diff ) ; skipManager.render ( prefs.context ( ) , diff ) ; }