auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private int transitions ( java.lang.String pattern ) { if ( pattern.startsWith ( RefRight.REGEX_PREFIX ) ) { return com.google.gerrit.server.project.RefControl.toRegExp ( pattern ) . toAutomaton ( ) . getNumberOfTransitions ( ) ; } else if ( pattern.endsWith ( "/*" ) ) { return pattern.length ( ) ; } else { return pattern.length ( ) ; } }

Target:
private int transitions ( java.lang.String pattern ) { if ( com.google.gerrit.server.project.RefControl.isRE ( pattern ) ) { return com.google.gerrit.server.project.RefControl.toRegExp ( pattern ) . toAutomaton ( ) . getNumberOfTransitions ( ) ; } else if ( pattern.endsWith ( "/*" ) ) { return pattern.length ( ) ; } else { return pattern.length ( ) ; } }
Source:
public void filterOutMoreThanOnePageOfResults ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change = insert ( newChangeForUser ( repo , userId ) ) ; com.google.gerrit.reviewdb.client.Account.Id user2 = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "anotheruser" ) ) . getAccountId ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { insert ( newChangeForUser ( repo , user2 ) ) ; } assertQuery ( "status:new ownerin:Administrators" , change ) ; assertQuery ( "status:new ownerin:Administrators limit:2" , change ) ; }

Target:
public void filterOutAllResults ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Account.Id user2 = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "anotheruser" ) ) . getAccountId ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { insert ( repo , newChange ( repo ) , user2 ) ; } assertQuery ( "status:new ownerin:Administrators" ) ; assertQuery ( "status:new ownerin:Administrators limit:2" ) ; }
Source:
void addRef ( java.lang.String ref ) { if ( com.googlesource.gerrit.plugins.replication.PushOne.ALL_REFS.equals ( ref ) ) { delta.clear ( ) ; pushAllRefs = true ; } else if ( ! ( pushAllRefs ) ) { delta.add ( ref ) ; } }

Target:
void addRef ( java.lang.String ref ) { if ( com.googlesource.gerrit.plugins.replication.PushOne.ALL_REFS.equals ( ref ) ) { delta.clear ( ) ; pushAllRefs = true ; com.googlesource.gerrit.plugins.replication.PushOne.log.trace ( ( "Added all refs for replication to " + ( uri ) ) ) ; } else if ( ! ( pushAllRefs ) ) { delta.add ( ref ) ; com.googlesource.gerrit.plugins.replication.PushOne.log.trace ( ( ( ( "Added ref " + ref ) + " for replication to " ) + ( uri ) ) ) ; } }
Source:
protected void configureServlets ( ) { serveRegex ( "/index/account/\\d+$" ) . with ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexAccountRestApiServlet.class ) ; serveRegex ( "/index/change/\\d+$" ) . with ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexChangeRestApiServlet.class ) ; serveRegex ( "/index/group/\\w+$" ) . with ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexGroupRestApiServlet.class ) ; serve ( "/event" ) . with ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.EventRestApiServlet.class ) ; serve ( "/cache/*" ) . with ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.CacheRestApiServlet.class ) ; }

Target:
protected void configureServlets ( ) { serveRegex ( "/index/account/\\d+$" ) . with ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexAccountRestApiServlet.class ) ; serveRegex ( "/index/change/\\d+$" ) . with ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexChangeRestApiServlet.class ) ; serveRegex ( "/index/group/\\w+$" ) . with ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexGroupRestApiServlet.class ) ; serve ( "/event" ) . with ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.EventRestApiServlet.class ) ; serve ( "/cache/project_list/*" ) . with ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.ProjectListApiServlet.class ) ; serve ( "/cache/*" ) . with ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.CacheRestApiServlet.class ) ; }
Source:
public void setEnableSmallFileFeatures ( final boolean on ) { enableSmallFileFeatures = on ; if ( enableSmallFileFeatures ) { syntaxHighlighting.setValue ( getValue ( ) . isSyntaxHighlighting ( ) ) ; } else { syntaxHighlighting.setValue ( false ) ; } toggleEnabledStatus ( update.isEnabled ( ) ) ; }

Target:
public void setEnableSmallFileFeatures ( final boolean on ) { enableSmallFileFeatures = on ; if ( enableSmallFileFeatures ) { syntaxHighlighting.setValue ( getValue ( ) . isSyntaxHighlighting ( ) ) ; } else { syntaxHighlighting.setValue ( false ) ; } toggleEnabledStatus ( save.isEnabled ( ) ) ; }
Source:
private void populateTableHeader ( final com.google.gerrit.common.data.PatchScript script , final com.google.gerrit.common.data.PatchSetDetail detail ) { prepareHeaderWidgets ( script , detail ) ; table.setWidget ( com.google.gerrit.client.patches.R_HEAD , com.google.gerrit.client.patches.UnifiedDiffTable.PC , psListOfHeaderA ) ; table.setWidget ( rowOfTableHeaderB , com.google.gerrit.client.patches.UnifiedDiffTable.PC , psListOfHeaderB ) ; table.getFlexCellFormatter ( ) . addStyleName ( com.google.gerrit.client.patches.R_HEAD , com.google.gerrit.client.patches.UnifiedDiffTable.PC , Gerrit.RESOURCES.css ( ) . unifiedTableHeader ( ) ) ; table.getFlexCellFormatter ( ) . addStyleName ( rowOfTableHeaderB , com.google.gerrit.client.patches.UnifiedDiffTable.PC , Gerrit.RESOURCES.css ( ) . unifiedTableHeader ( ) ) ; }

Target:
protected void createFileCommentEditorOnSideB ( ) { createCommentEditor ( ( ( rowOfTableHeaderB ) + 1 ) , com.google.gerrit.client.patches.UnifiedDiffTable.PC , com.google.gerrit.client.patches.R_HEAD , com.google.gerrit.client.patches.FILE_SIDE_B ) ; }
Source:
protected void setUp ( ) throws java.lang.Exception { if ( com.google.gerrit.server.util.HostPlatform.isWin32 ( ) ) { throw new com.google.gerrit.server.tools.hooks.CommitMsgHookTest.SkipTestOnThisPlatform ( ) ; } super . setUp ( ) ; final java.util.Date when = author.getWhen ( ) ; final java.util.TimeZone tz = author.getTimeZone ( ) ; author = new org.eclipse.jgit.lib.PersonIdent ( "J. Author" , "ja@example.com" ) ; author = new org.eclipse.jgit.lib.PersonIdent ( author , when , tz ) ; committer = new org.eclipse.jgit.lib.PersonIdent ( "J. Committer" , "jc@example.com" ) ; committer = new org.eclipse.jgit.lib.PersonIdent ( committer , when , tz ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { skipIfWin32Platform ( ) ; super . setUp ( ) ; final java.util.Date when = author.getWhen ( ) ; final java.util.TimeZone tz = author.getTimeZone ( ) ; author = new org.eclipse.jgit.lib.PersonIdent ( "J. Author" , "ja@example.com" ) ; author = new org.eclipse.jgit.lib.PersonIdent ( author , when , tz ) ; committer = new org.eclipse.jgit.lib.PersonIdent ( "J. Committer" , "jc@example.com" ) ; committer = new org.eclipse.jgit.lib.PersonIdent ( committer , when , tz ) ; }
Source:
private java.lang.String getCommand ( java.lang.String command , com.google.gitiles.RevisionParser.Result result , java.lang.String path ) { if ( ! ( com.google.gitiles.ViewFilter.CMD_AUTO.equals ( command ) ) ) { return command ; } else if ( ( result.getOldRevision ( ) ) != null ) { return com.google.gitiles.ViewFilter.CMD_DIFF ; } else { return com.google.gitiles.ViewFilter.CMD_SHOW ; } }

Target:
private GitilesView.Builder parseAutoCommand ( javax.servlet.http.HttpServletRequest req , java.lang.String repoName , java.lang.String path ) throws java.io.IOException { if ( path.isEmpty ( ) ) { return null ; } com.google.gitiles.RevisionParser.Result result = parseRevision ( req , path ) ; if ( result == null ) { return null ; } if ( ( result.getOldRevision ( ) ) != null ) { return parseDiffCommand ( repoName , result ) ; } else { return parseShowCommand ( repoName , result ) ; } }
Source:
void onReplyDone ( com.google.gwt.event.dom.client.ClickEvent e ) { if ( ( replyBox ) == null ) { com.google.gerrit.client.diff.DraftBox box = getDiffView ( ) . addReply ( getOriginal ( ) , "Done" , true ) ; registerReplyBox ( box ) ; } else { openReplyBox ( ) ; } }

Target:
void doReply ( ) { if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( parent.getToken ( ) ) ; } else if ( ( replyBox ) == null ) { com.google.gerrit.client.diff.DraftBox box = addReplyBox ( ) ; if ( ! ( getCommentInfo ( ) . has_line ( ) ) ) { parent.addFileCommentBox ( box , comment.side ( ) ) ; } } else { openReplyBox ( ) ; } }
Source:
private void sendDone ( ) { spinnerState = com.google.gerrit.server.git.MultiProgressMonitor.NO_SPINNER ; java.lang.StringBuilder s = format ( ) ; s.append ( ", done \n" ) ; send ( s ) ; }

Target:
private void sendDone ( ) { spinnerState = com.google.gerrit.server.git.MultiProgressMonitor.NO_SPINNER ; java.lang.StringBuilder s = format ( ) ; boolean any = false ; for ( com.google.gerrit.server.git.MultiProgressMonitor.Task t : tasks ) { if ( ( t.count ) != 0 ) { any = true ; break ; } } if ( any ) { s.append ( ", " ) ; } s.append ( "done \n" ) ; send ( s ) ; }
Source:
private static void putApprovals ( com.google.gerrit.server.notedb.ChangeUpdate update , java.util.Map < java.lang.String , com.google.common.base.Optional < java.lang.Short > > approvals ) { for ( java.util.Map.Entry < java.lang.String , com.google.common.base.Optional < java.lang.Short > > e : approvals.entrySet ( ) ) { if ( e.getValue ( ) . isPresent ( ) ) { update.putApproval ( e.getKey ( ) , e.getValue ( ) . get ( ) ) ; } else { update.removeApproval ( e.getKey ( ) ) ; } } }

Target:
private static java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > convertPatchSet ( java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals , final com.google.gerrit.reviewdb.client.PatchSet.Id psId ) { return com.google.common.collect.Iterables.transform ( approvals , new com.google.common.base.Function < com.google.gerrit.reviewdb.client.PatchSetApproval , com.google.gerrit.reviewdb.client.PatchSetApproval > ( ) { @ java.lang.Override public com.google.gerrit.reviewdb.client.PatchSetApproval apply ( com.google.gerrit.reviewdb.client.PatchSetApproval in ) { if ( in.getPatchSetId ( ) . equals ( psId ) ) { return in ; } else { return new com.google.gerrit.reviewdb.client.PatchSetApproval ( psId , in ) ; } } } ) ; }
Source:
public com.google.gerrit.reviewdb.Change update ( com.google.gerrit.reviewdb.Change change ) { if ( ( ( change.getStatus ( ) ) == ( Change.Status.DRAFT ) ) && ( change.currentPatchSetId ( ) . equals ( patchSetId ) ) ) { change.setStatus ( Change.Status.NEW ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; return change ; } else { return null ; } }

Target:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change change ) { change.setCurrentPatchSet ( info ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; return change ; }
Source:
private static org.bouncycastle.bcpg.sig.RevocationReason getRevocationReason ( org.bouncycastle.openpgp.PGPSignature sig ) { if ( ( sig.getSignatureType ( ) ) != ( org.bouncycastle.openpgp.PGPSignature.KEY_REVOCATION ) ) { throw new java.lang.IllegalArgumentException ( ( "Expected KEY_REVOCATION signature, got " + ( sig.getSignatureType ( ) ) ) ) ; } org.bouncycastle.bcpg.SignatureSubpacket sub = sig.getHashedSubPackets ( ) . getSubpacket ( org.bouncycastle.bcpg.SignatureSubpacketTags.REVOCATION_REASON ) ; if ( sub == null ) { return null ; } return new org.bouncycastle.bcpg.sig.RevocationReason ( sub.isCritical ( ) , sub.getData ( ) ) ; }

Target:
private static org.bouncycastle.bcpg.sig.RevocationReason getRevocationReason ( org.bouncycastle.openpgp.PGPSignature sig ) { if ( ( sig.getSignatureType ( ) ) != ( org.bouncycastle.openpgp.PGPSignature.KEY_REVOCATION ) ) { throw new java.lang.IllegalArgumentException ( ( "Expected KEY_REVOCATION signature, got " + ( sig.getSignatureType ( ) ) ) ) ; } org.bouncycastle.bcpg.SignatureSubpacket sub = sig.getHashedSubPackets ( ) . getSubpacket ( org.bouncycastle.bcpg.SignatureSubpacketTags.REVOCATION_REASON ) ; if ( sub == null ) { return null ; } return new org.bouncycastle.bcpg.sig.RevocationReason ( sub.isCritical ( ) , sub.isLongLength ( ) , sub.getData ( ) ) ; }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > patchSetDrafts ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByPatchSetAuthor ( db.get ( ) , rsrc.getPatchSet ( ) . getId ( ) , rsrc.getAccountId ( ) , rsrc.getNotes ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }

Target:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > patchSetDrafts ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByPatchSetAuthor ( ctx.getDb ( ) , psId , user.getAccountId ( ) , ctx.getChangeNotes ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }
Source:
private < T > T executeWithAttemptCount ( com.google.gerrit.server.update.RetryHelper.ActionType actionType , com.google.gerrit.server.update.RetryHelper.Action < T > action , com.google.gerrit.server.update.RetryHelper.Options opts , com.google.common.base.Predicate < java.lang.Throwable > exceptionPredicate ) throws java.lang.Throwable { com.google.gerrit.server.update.RetryHelper.MetricListener listener = new com.google.gerrit.server.update.RetryHelper.MetricListener ( ) ; try { com.github.rholder.retry.RetryerBuilder < T > retryerBuilder = createRetryerBuilder ( opts , exceptionPredicate ) ; retryerBuilder.withRetryListener ( listener ) ; return executeWithTimeoutCount ( actionType , action , retryerBuilder.build ( ) ) ; } finally { metrics.attemptCounts.record ( actionType , listener.getAttemptCount ( ) ) ; } }

Target:
private < T > T executeWithAttemptAndTimeoutCount ( com.google.gerrit.server.update.RetryHelper.ActionType actionType , com.google.gerrit.server.update.RetryHelper.Action < T > action , com.google.gerrit.server.update.RetryHelper.Options opts , com.google.common.base.Predicate < java.lang.Throwable > exceptionPredicate ) throws java.lang.Throwable { com.google.gerrit.server.update.RetryHelper.MetricListener listener = new com.google.gerrit.server.update.RetryHelper.MetricListener ( ) ; try { com.github.rholder.retry.RetryerBuilder < T > retryerBuilder = createRetryerBuilder ( opts , exceptionPredicate ) ; retryerBuilder.withRetryListener ( listener ) ; return executeWithTimeoutCount ( actionType , action , retryerBuilder.build ( ) ) ; } finally { metrics.attemptCounts.record ( actionType , listener.getAttemptCount ( ) ) ; } }
Source:
protected void onInitUI ( ) { super . onInitUI ( ) ; table = new com.google.gerrit.client.changes.ChangeTable ( ) ; byOwner = new com.google.gerrit.client.changes.ChangeTable.Section ( "" ) ; forReview = new com.google.gerrit.client.changes.ChangeTable.Section ( "" ) ; closed = new com.google.gerrit.client.changes.ChangeTable.Section ( "" ) ; table.addSection ( byOwner ) ; table.addSection ( forReview ) ; table.addSection ( closed ) ; add ( table ) ; table.setSavePointerId ( com.google.gerrit.client.Link.toAccountDashboard ( ownerId ) ) ; }

Target:
protected void onInitUI ( ) { super . onInitUI ( ) ; table = new com.google.gerrit.client.changes.ChangeTable ( true ) ; byOwner = new com.google.gerrit.client.changes.ChangeTable.Section ( "" , com.google.gerrit.client.changes.ChangeTable.ApprovalViewType.STRONGEST , null ) ; forReview = new com.google.gerrit.client.changes.ChangeTable.Section ( "" , com.google.gerrit.client.changes.ChangeTable.ApprovalViewType.USER , ownerId ) ; closed = new com.google.gerrit.client.changes.ChangeTable.Section ( "" , com.google.gerrit.client.changes.ChangeTable.ApprovalViewType.STRONGEST , null ) ; table.addSection ( byOwner ) ; table.addSection ( forReview ) ; table.addSection ( closed ) ; add ( table ) ; table.setSavePointerId ( com.google.gerrit.client.Link.toAccountDashboard ( ownerId ) ) ; }
Source:
public void getDraft ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; java.lang.String changeId = r.getChangeId ( ) ; java.lang.String revId = r.getCommit ( ) . getName ( ) ; com.google.gerrit.extensions.api.changes.ReviewInput.CommentInput comment = newCommentInfo ( "file1" , Side.REVISION , 1 , "comment 1" ) ; com.google.gerrit.extensions.common.CommentInfo returned = addDraft ( changeId , revId , comment ) ; com.google.gerrit.extensions.common.CommentInfo actual = getDraftComment ( changeId , revId , returned.id ) ; com.google.gerrit.acceptance.server.change.CommentsIT.assertCommentInfo ( comment , actual ) ; }

Target:
public void getDraft ( ) throws java.lang.Exception { for ( java.lang.Integer line : lines ) { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; java.lang.String changeId = r.getChangeId ( ) ; java.lang.String revId = r.getCommit ( ) . getName ( ) ; com.google.gerrit.extensions.api.changes.ReviewInput.CommentInput comment = newCommentInfo ( "file1" , Side.REVISION , line , "comment 1" ) ; com.google.gerrit.extensions.common.CommentInfo returned = addDraft ( changeId , revId , comment ) ; com.google.gerrit.extensions.common.CommentInfo actual = getDraftComment ( changeId , revId , returned.id ) ; com.google.gerrit.acceptance.server.change.CommentsIT.assertCommentInfo ( comment , actual ) ; } }
Source:
public void currentPatchSetMissing ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; db.patchSets ( ) . deleteKeys ( java.util.Collections.singleton ( ctl.getChange ( ) . currentPatchSetId ( ) ) ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( "Current patch set 1 not found" ) ) ; }

Target:
public void currentPatchSetMissing ( ) throws java.lang.Exception { assumeNoteDbDisabled ( ) ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; db.patchSets ( ) . deleteKeys ( java.util.Collections.singleton ( ctl.getChange ( ) . currentPatchSetId ( ) ) ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( "Current patch set 1 not found" ) ) ; }
Source:
public static boolean canRead ( final com.google.gerrit.client.reviewdb.Account.Id who , final com.google.gerrit.client.data.ProjectCache.Entry e ) { if ( e == null ) { return false ; } final java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > myGroups = com.google.gerrit.client.rpc.Common.getGroupCache ( ) . getEffectiveGroups ( who ) ; return com.google.gerrit.client.rpc.BaseServiceImplementation.canPerform ( myGroups , e , ApprovalCategory.READ , ( ( short ) ( 1 ) ) , true ) ; }

Target:
public static boolean canPerform ( final com.google.gerrit.client.reviewdb.Account.Id who , final com.google.gerrit.client.data.ProjectCache.Entry e , final com.google.gerrit.client.reviewdb.ApprovalCategory.Id actionId , final short requireValue ) { java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > groups = com.google.gerrit.client.rpc.Common.getGroupCache ( ) . getEffectiveGroups ( who ) ; return com.google.gerrit.client.rpc.BaseServiceImplementation.canPerform ( groups , e , actionId , requireValue ) ; }
Source:
private java.util.Map < org.eclipse.jgit.lib.ObjectId , org.eclipse.jgit.lib.Ref > changeRefsById ( ) throws java.io.IOException { if ( ( refsById ) == null ) { refsById = new java.util.HashMap < org.eclipse.jgit.lib.ObjectId , org.eclipse.jgit.lib.Ref > ( ) ; for ( org.eclipse.jgit.lib.Ref r : repo.getRefDatabase ( ) . getRefs ( "refs/changes/" ) . values ( ) ) { if ( com.google.gerrit.reviewdb.client.PatchSet.isRef ( r.getName ( ) ) ) { refsById.put ( r.getObjectId ( ) , r ) ; } } } return refsById ; }

Target:
private com.google.common.collect.SetMultimap < org.eclipse.jgit.lib.ObjectId , org.eclipse.jgit.lib.Ref > changeRefsById ( ) throws java.io.IOException { if ( ( refsById ) == null ) { refsById = com.google.common.collect.HashMultimap.create ( ) ; for ( org.eclipse.jgit.lib.Ref r : repo.getRefDatabase ( ) . getRefs ( "refs/changes/" ) . values ( ) ) { if ( com.google.gerrit.reviewdb.client.PatchSet.isRef ( r.getName ( ) ) ) { refsById.put ( r.getObjectId ( ) , r ) ; } } } return refsById ; }
Source:
public void testCreateProjectWithoutCapability_Forbidden ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = userSession.put ( "/projects/newProject" ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_FORBIDDEN ) ; }

Target:
private void assertCreateFails ( com.google.gerrit.extensions.api.projects.ProjectInput in , java.lang.Class < ? extends com.google.gerrit.extensions.restapi.RestApiException > errType ) throws java.lang.Exception { try { gApi.projects ( ) . create ( in ) ; org.junit.Assert.fail ( ( "Expected " + ( errType.getSimpleName ( ) ) ) ) ; } catch ( com.google.gerrit.extensions.restapi.RestApiException expected ) { com.google.common.truth.Truth.assertThat ( expected ) . isInstanceOf ( errType ) ; } }
Source:
private void computeAllowed ( ) { final com.google.gerrit.client.reviewdb.Account.Id me = com.google.gerrit.client.rpc.Common.getAccountId ( ) ; final java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > am = com.google.gerrit.client.rpc.Common.getGroupCache ( ) . getEffectiveGroups ( me ) ; final com.google.gerrit.client.data.ProjectCache.Entry pe = com.google.gerrit.client.rpc.Common.getProjectCache ( ) . get ( change.getDest ( ) . getParentKey ( ) ) ; computeAllowed ( am , pe.getRights ( ) ) ; computeAllowed ( am , com.google.gerrit.client.rpc.Common.getProjectCache ( ) . getWildcardRights ( ) ) ; }

Target:
public void setChange ( com.google.gerrit.client.reviewdb.Change change ) { this . change = change ; }
Source:
private java.lang.String getPublicKeyPart ( int index , java.lang.String defaultValue ) { java.lang.String s = getSshPublicKey ( ) ; if ( ( s != null ) && ( ( s.length ( ) ) > 0 ) ) { java.lang.String [ ] parts = s.split ( " " ) ; if ( ( parts.length ) > index ) { return parts [ index ] ; } } return defaultValue ; }

Target:
private java.lang.String getPublicKeyPart ( int index , java.lang.String defaultValue ) { java.lang.String s = getSshPublicKey ( ) ; if ( ( s != null ) && ( ( s.length ( ) ) > 0 ) ) { java.util.List < java.lang.String > parts = com.google.common.base.Splitter.on ( ' ' ) . splitToList ( s ) ; if ( ( parts.size ( ) ) > index ) { return parts.get ( index ) ; } } return defaultValue ; }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > changeDrafts ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByChangeAuthor ( ctx.getDb ( ) , ctx.getChangeNotes ( ) , user.getAccountId ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }

Target:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > patchSetDrafts ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = new java.util.HashMap < > ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByPatchSetAuthor ( ctx.getDb ( ) , psId , user.getAccountId ( ) , ctx.getNotes ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }
Source:
public void noChangeMessage ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.putReviewer ( changeOwner.getAccount ( ) . getId ( ) , com.google.gerrit.server.notedb.ReviewerState.REVIEWER ) ; update.commit ( ) ; assertBodyEquals ( ( "Update patch set 1\n" + ( ( "\n" + "Patch-set: 1\n" ) + "Reviewer: Change Owner <1@gerrit>\n" ) ) , update.getRevision ( ) ) ; }

Target:
public void noChangeMessage ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.putReviewer ( changeOwner.getAccount ( ) . getId ( ) , com.google.gerrit.server.notedb.ReviewerStateInternal.REVIEWER ) ; update.commit ( ) ; assertBodyEquals ( ( "Update patch set 1\n" + ( ( "\n" + "Patch-set: 1\n" ) + "Reviewer: Change Owner <1@gerrit>\n" ) ) , update.getRevision ( ) ) ; }
Source:
private org.eclipse.jgit.revwalk.RevCommit commit ( com.google.gerrit.server.notedb.ChangeUpdate update ) throws java.io.IOException { com.google.gerrit.server.git.MetaDataUpdate md = new com.google.gerrit.server.git.MetaDataUpdate ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.DISABLED , project , repo ) ; java.sql.Timestamp ts = com.google.gerrit.server.util.TimeUtil.nowTs ( ) ; md.getCommitBuilder ( ) . setAuthor ( new org.eclipse.jgit.lib.PersonIdent ( "Example User" , "user@example.com" , ts , com.google.gerrit.server.notedb.ChangeNotesTest.TZ ) ) ; md.getCommitBuilder ( ) . setCommitter ( new org.eclipse.jgit.lib.PersonIdent ( "Gerrit Test" , "notthis@email.com" , ts , com.google.gerrit.server.notedb.ChangeNotesTest.TZ ) ) ; return update.commit ( md ) ; }

Target:
private org.eclipse.jgit.revwalk.RevCommit commit ( com.google.gerrit.server.notedb.ChangeUpdate update ) throws java.io.IOException { com.google.gerrit.server.git.MetaDataUpdate md = new com.google.gerrit.server.git.MetaDataUpdate ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.DISABLED , project , repo ) ; md.getCommitBuilder ( ) . setAuthor ( new org.eclipse.jgit.lib.PersonIdent ( update.getAccount ( ) . getFullName ( ) , update.getAccount ( ) . getPreferredEmail ( ) , update.getWhen ( ) , com.google.gerrit.server.notedb.ChangeNotesTest.TZ ) ) ; return update.commit ( md ) ; }
Source:
private int showResultSet ( final java.sql.ResultSet rs , boolean alreadyOnRow , com.google.gerrit.sshd.commands.QueryShell.Function ... show ) throws java.sql.SQLException { switch ( outputFormat ) { case JSON : return showResultSetJson ( rs , alreadyOnRow , show ) ; case PRETTY : default : return showResultSetPretty ( rs , alreadyOnRow , show ) ; } }

Target:
private void showResultSet ( final java.sql.ResultSet rs , boolean alreadyOnRow , long start , com.google.gerrit.sshd.commands.QueryShell.Function ... show ) throws java.sql.SQLException { switch ( outputFormat ) { case JSON_SINGLE : case JSON : showResultSetJson ( rs , alreadyOnRow , start , show ) ; break ; case PRETTY : default : showResultSetPretty ( rs , alreadyOnRow , start , show ) ; break ; } }
Source:
public boolean isChangeUpToDate ( com.google.gerrit.server.git.RefCache changeRepoRefs ) throws java.io.IOException { com.google.common.base.Optional < org.eclipse.jgit.lib.ObjectId > id = changeRepoRefs.get ( com.google.gerrit.reviewdb.client.RefNames.changeMetaRef ( changeId ) ) ; if ( ! ( id.isPresent ( ) ) ) { return changeMetaId.equals ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) ) ; } return id.get ( ) . equals ( changeMetaId ) ; }

Target:
public boolean isChangeUpToDate ( com.google.gerrit.server.git.RefCache changeRepoRefs ) throws java.io.IOException { java.util.Optional < org.eclipse.jgit.lib.ObjectId > id = changeRepoRefs.get ( com.google.gerrit.reviewdb.client.RefNames.changeMetaRef ( changeId ) ) ; if ( ! ( id.isPresent ( ) ) ) { return changeMetaId.equals ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) ) ; } return id.get ( ) . equals ( changeMetaId ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.change.RelatedChanges.RelatedInfo result ) { if ( ( result.changes ( ) . length ( ) ) > 0 ) { getTab ( ) . setTitle ( Resources.M.relatedChanges ( result.changes ( ) . length ( ) ) ) ; getTab ( ) . setChanges ( info.project ( ) , revision , result.changes ( ) ) ; } }

Target:
public com.google.gwt.core.client.JsArray < com.google.gerrit.client.change.RelatedChanges.ChangeAndCommit > convert ( com.google.gerrit.client.change.RelatedChanges.RelatedInfo result ) { return result.changes ( ) ; }
Source:
public com.google.gwtjsonrpc.client.VoidResult run ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gerrit.server.rpc.Failure , com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; assertAmGroupOwner ( db , group ) ; group.setDescription ( description ) ; db.accountGroups ( ) . update ( java.util.Collections.singleton ( group ) ) ; 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.server.rpc.Failure , com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; assertAmGroupOwner ( db , group ) ; group.setDescription ( description ) ; db.accountGroups ( ) . update ( java.util.Collections.singleton ( group ) ) ; groupCache.evict ( groupId ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }
Source:
private void updateScreenHeader ( net.codemirror.lib.ScrollInfo si ) { if ( ( ( si.getTop ( ) ) == 0 ) && ( ! ( diffTable.isHeaderVisible ( ) ) ) ) { diffTable.setHeaderVisible ( true ) ; } else if ( ( ( si.getTop ( ) ) > ( 0.5 * ( si.getClientHeight ( ) ) ) ) && ( diffTable.isHeaderVisible ( ) ) ) { diffTable.setHeaderVisible ( false ) ; } }

Target:
private void updateScreenHeader ( net.codemirror.lib.ScrollInfo si ) { if ( ( ( si.top ( ) ) == 0 ) && ( ! ( diffTable.isHeaderVisible ( ) ) ) ) { diffTable.setHeaderVisible ( true ) ; } else if ( ( ( si.top ( ) ) > ( 0.5 * ( si.clientHeight ( ) ) ) ) && ( diffTable.isHeaderVisible ( ) ) ) { diffTable.setHeaderVisible ( false ) ; } }
Source:
public void onOpen ( final com.google.gwt.event.logical.shared.OpenEvent < com.google.gwt.user.client.ui.DisclosurePanel > event ) { if ( ( infoTable ) == null ) { Util.DETAIL_SVC.patchSetDetail ( patchSet.getId ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.common.data.PatchSetDetail > ( ) { public void onSuccess ( final com.google.gerrit.common.data.PatchSetDetail result ) { ensureLoaded ( result ) ; } } ) ; } }

Target:
public void onOpen ( final com.google.gwt.event.logical.shared.OpenEvent < com.google.gwt.user.client.ui.DisclosurePanel > event ) { if ( ( infoTable ) == null ) { Util.DETAIL_SVC.patchSetDetail ( patchSet.getId ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.common.data.PatchSetDetail > ( ) { public void onSuccess ( final com.google.gerrit.common.data.PatchSetDetail result ) { ensureLoaded ( result ) ; patchTable.setRegisterKeys ( true ) ; } } ) ; } }
Source:
public com.google.gerrit.server.update.BatchUpdate insertChange ( com.google.gerrit.server.update.InsertChangeOp op ) { com.google.gerrit.server.update.BatchUpdate.ContextImpl ctx = new com.google.gerrit.server.update.BatchUpdate.ContextImpl ( ) ; com.google.gerrit.reviewdb.client.Change c = op.createChange ( ctx ) ; com.google.common.base.Preconditions.checkArgument ( ( ! ( newChanges.containsKey ( c.getId ( ) ) ) ) , "only one op allowed to create change %s" , c.getId ( ) ) ; newChanges.put ( c.getId ( ) , c ) ; ops.get ( c.getId ( ) ) . add ( 0 , op ) ; return this ; }

Target:
public com.google.gerrit.server.update.BatchUpdate insertChange ( com.google.gerrit.server.update.InsertChangeOp op ) { com.google.gerrit.server.update.Context ctx = newContext ( ) ; com.google.gerrit.reviewdb.client.Change c = op.createChange ( ctx ) ; com.google.common.base.Preconditions.checkArgument ( ( ! ( newChanges.containsKey ( c.getId ( ) ) ) ) , "only one op allowed to create change %s" , c.getId ( ) ) ; newChanges.put ( c.getId ( ) , c ) ; ops.get ( c.getId ( ) ) . add ( 0 , op ) ; return this ; }
Source:
private synchronized void runHook ( com.google.gerrit.reviewdb.client.Project.NameKey project , java.io.File hook , java.util.List < java.lang.String > args ) { if ( ( project != null ) && ( hook.exists ( ) ) ) { hookQueue.execute ( new com.google.gerrit.common.ChangeHookRunner.AsyncHookTask ( project , hook , args ) ) ; } }

Target:
private synchronized void runHook ( com.google.gerrit.reviewdb.client.Project.NameKey project , java.nio.file.Path hook , java.util.List < java.lang.String > args ) { if ( ( project != null ) && ( java.nio.file.Files.exists ( hook ) ) ) { hookQueue.execute ( new com.google.gerrit.common.ChangeHookRunner.AsyncHookTask ( project , hook , args ) ) ; } }
Source:
private void readObject ( final java.io.ObjectInputStream in ) throws java.io.IOException { final byte [ ] idBuf = new byte [ org.spearce.jgit.lib.Constants.OBJECT_ID_LENGTH ] ; projectKey = new com.google.gerrit.client.reviewdb.Project.NameKey ( in.readUTF ( ) ) ; if ( in.readBoolean ( ) ) { in.readFully ( idBuf ) ; oldId = org.spearce.jgit.lib.ObjectId.fromRaw ( idBuf ) ; } in.readFully ( idBuf ) ; newId = org.spearce.jgit.lib.ObjectId.fromRaw ( idBuf ) ; fileName = com.google.gerrit.server.patch.DiffCacheKey.readString ( in ) ; sourceFileName = com.google.gerrit.server.patch.DiffCacheKey.readString ( in ) ; }

Target:
private void readObject ( final java.io.ObjectInputStream in ) throws java.io.IOException { projectKey = new com.google.gerrit.client.reviewdb.Project.NameKey ( in.readUTF ( ) ) ; oldId = org.spearce.jgit.lib.ObjectIdSerialization.read ( in ) ; newId = org.spearce.jgit.lib.ObjectIdSerialization.read ( in ) ; fileName = com.google.gerrit.server.patch.DiffCacheKey.readString ( in ) ; sourceFileName = com.google.gerrit.server.patch.DiffCacheKey.readString ( in ) ; }
Source:
private com.google.common.collect.SetMultimap < org.eclipse.jgit.lib.ObjectId , org.eclipse.jgit.lib.Ref > changeRefsById ( ) throws java.io.IOException { if ( ( refsById ) == null ) { refsById = com.google.common.collect.HashMultimap.create ( ) ; for ( org.eclipse.jgit.lib.Ref r : refsByChange ( ) . values ( ) ) { refsById.put ( r.getObjectId ( ) , r ) ; } } return refsById ; }

Target:
private com.google.common.collect.SetMultimap < org.eclipse.jgit.lib.ObjectId , org.eclipse.jgit.lib.Ref > changeRefsById ( ) { initChangeRefMaps ( ) ; return refsById ; }
Source:
public void addComment ( java.lang.String issueKey , java.lang.String comment ) throws java.io.IOException { execute ( ( ) -> { log.debug ( "Adding comment to issue {}" , comment , issueKey ) ; client ( ) . addComment ( issueKey , comment ) ; log.debug ( "Added comment to issue {}" , comment , issueKey ) ; return issueKey ; } ) ; }

Target:
public void addComment ( java.lang.String issueKey , java.lang.String comment ) throws java.io.IOException { execute ( ( ) -> { log.debug ( "Adding comment to issue {}" , comment , issueKey ) ; jiraClient.addComment ( issueKey , comment ) ; log.debug ( "Added comment to issue {}" , comment , issueKey ) ; return issueKey ; } ) ; }
Source:
public boolean isDirectChild ( ) { com.google.gerrit.server.project.ProjectState parent = com.google.common.collect.Iterables.getFirst ( child.getProjectState ( ) . parents ( ) , null ) ; return ( parent != null ) && ( getNameKey ( ) . equals ( parent.getProject ( ) . getNameKey ( ) ) ) ; }

Target:
public com.google.gerrit.server.project.ProjectResource getParent ( ) { return parent ; }
Source:
public void revisionActionsOneChangePerTopicUnapproved ( ) throws java.lang.Exception { java.lang.String changeId = createChangeWithTopic ( "foo1" ) . getChangeId ( ) ; java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > actions = getActions ( changeId ) ; com.google.common.truth.Truth.assertThat ( actions ) . containsKey ( "cherrypick" ) ; com.google.common.truth.Truth.assertThat ( actions ) . hasSize ( 1 ) ; }

Target:
public void revisionActionsOneChangePerTopicUnapproved ( ) throws java.lang.Exception { java.lang.String changeId = createChangeWithTopic ( "foo1" ) . getChangeId ( ) ; java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > actions = getActions ( changeId ) ; com.google.common.truth.Truth.assertThat ( actions ) . containsKey ( "cherrypick" ) ; com.google.common.truth.Truth.assertThat ( actions ) . containsKey ( "rebase" ) ; com.google.common.truth.Truth.assertThat ( actions ) . hasSize ( 2 ) ; }
Source:
protected void configure ( ) { factory ( AbandonChangeHandler.Factory.class ) ; factory ( RestoreChangeHandler.Factory.class ) ; factory ( RevertChange.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( SubmitAction.Factory.class ) ; factory ( PublishAction.Factory.class ) ; factory ( DeleteDraftChange.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( AbandonChangeHandler.Factory.class ) ; factory ( RestoreChangeHandler.Factory.class ) ; factory ( RevertChange.Factory.class ) ; factory ( RebaseChange.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( SubmitAction.Factory.class ) ; factory ( PublishAction.Factory.class ) ; factory ( DeleteDraftChange.Factory.class ) ; }
Source:
private com.google.inject.AbstractModule createIndexModule ( ) { com.google.gerrit.server.index.IndexModule.IndexType indexType = com.google.gerrit.server.index.IndexModule.getIndexType ( cfgInjector ) ; switch ( indexType ) { case LUCENE : return ( luceneModule ) != null ? luceneModule : new com.google.gerrit.lucene.LuceneIndexModule ( ) ; case SOLR : return new com.google.gerrit.solr.SolrIndexModule ( ) ; default : throw new java.lang.IllegalStateException ( ( "unsupported index.type = " + indexType ) ) ; } }

Target:
private com.google.inject.AbstractModule createIndexModule ( ) { if ( slave ) { return new com.google.gerrit.server.index.DummyIndexModule ( ) ; } com.google.gerrit.server.index.IndexModule.IndexType indexType = com.google.gerrit.server.index.IndexModule.getIndexType ( cfgInjector ) ; switch ( indexType ) { case LUCENE : return ( luceneModule ) != null ? luceneModule : new com.google.gerrit.lucene.LuceneIndexModule ( ) ; default : throw new java.lang.IllegalStateException ( ( "unsupported index.type = " + indexType ) ) ; } }
Source:
public boolean isOwner ( ) { if ( getUser ( ) . isIdentifiedUser ( ) ) { final com.google.gerrit.server.IdentifiedUser i = ( ( com.google.gerrit.server.IdentifiedUser ) ( getUser ( ) ) ) ; return i.getAccountId ( ) . equals ( getChange ( ) . getOwner ( ) ) ; } return false ; }

Target:
public boolean isOwner ( ) { if ( getUser ( ) . isIdentifiedUser ( ) ) { com.google.gerrit.reviewdb.client.Account.Id id = getUser ( ) . asIdentifiedUser ( ) . getAccountId ( ) ; return id.equals ( getChange ( ) . getOwner ( ) ) ; } return false ; }
Source:
protected void configureServlets ( ) { serve ( "/gitweb" ) . with ( com.google.gerrit.httpd.gitweb.GitwebServlet.class ) ; serve ( "/gitweb-logo.png" ) . with ( com.google.gerrit.httpd.gitweb.GitLogoServlet.class ) ; serve ( "/gitweb.js" ) . with ( com.google.gerrit.httpd.gitweb.GitwebJavaScriptServlet.class ) ; serve ( "/gitweb-default.css" ) . with ( GitwebCssServlet.Default.class ) ; serve ( "/gitweb-site.css" ) . with ( GitwebCssServlet.Site.class ) ; }

Target:
protected void configureServlets ( ) { serveRegex ( "^/(?:a/)?gitweb" ) . with ( com.google.gerrit.httpd.gitweb.GitwebServlet.class ) ; serve ( "/gitweb-logo.png" ) . with ( com.google.gerrit.httpd.gitweb.GitLogoServlet.class ) ; serve ( "/gitweb.js" ) . with ( com.google.gerrit.httpd.gitweb.GitwebJavaScriptServlet.class ) ; serve ( "/gitweb-default.css" ) . with ( GitwebCssServlet.Default.class ) ; serve ( "/gitweb-site.css" ) . with ( GitwebCssServlet.Site.class ) ; }
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.NotesMigration.Table t : com.google.gerrit.server.notedb.NotesMigration.Table.values ( ) ) { cfg.setBoolean ( com.google.gerrit.server.notedb.NotesMigration.NOTEDB , t.key ( ) , com.google.gerrit.server.notedb.NotesMigration.WRITE , true ) ; cfg.setBoolean ( com.google.gerrit.server.notedb.NotesMigration.NOTEDB , t.key ( ) , com.google.gerrit.server.notedb.NotesMigration.READ , true ) ; } return cfg ; }

Target:
public static void setAllEnabledConfig ( org.eclipse.jgit.lib.Config cfg ) { for ( com.google.gerrit.server.notedb.NotesMigration.Table t : com.google.gerrit.server.notedb.NotesMigration.Table.values ( ) ) { cfg.setBoolean ( com.google.gerrit.server.notedb.NotesMigration.NOTEDB , t.key ( ) , com.google.gerrit.server.notedb.NotesMigration.WRITE , true ) ; cfg.setBoolean ( com.google.gerrit.server.notedb.NotesMigration.NOTEDB , t.key ( ) , com.google.gerrit.server.notedb.NotesMigration.READ , true ) ; } }
Source:
public com.google.gerrit.server.account.AccountResource.Capability parse ( com.google.gerrit.server.account.AccountResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.permissions.PermissionBackendException { com.google.gerrit.server.IdentifiedUser target = parent.getUser ( ) ; if ( ( self.get ( ) ) != target ) { permissionBackend.user ( self ) . check ( GlobalPermission.ADMINISTRATE_SERVER ) ; } com.google.gerrit.extensions.api.access.GlobalOrPluginPermission perm = parse ( id ) ; if ( permissionBackend.user ( target ) . test ( perm ) ) { return new com.google.gerrit.server.account.AccountResource.Capability ( target , perm.permissionName ( ) ) ; } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; }

Target:
public com.google.gerrit.server.account.AccountResource.Capability parse ( com.google.gerrit.server.account.AccountResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.permissions.PermissionBackendException { com.google.gerrit.server.IdentifiedUser target = parent.getUser ( ) ; if ( ( self.get ( ) ) != target ) { permissionBackend.currentUser ( ) . check ( GlobalPermission.ADMINISTRATE_SERVER ) ; } com.google.gerrit.extensions.api.access.GlobalOrPluginPermission perm = parse ( id ) ; if ( permissionBackend.user ( target ) . test ( perm ) ) { return new com.google.gerrit.server.account.AccountResource.Capability ( target , perm.permissionName ( ) ) ; } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; }
Source:
public static com.google.gwt.event.shared.HandlerRegistration add ( final com.google.gwtexpui.globalkey.client.KeyCommandSet set ) { com.google.gwtexpui.globalkey.client.GlobalKey.init ( ) ; com.google.gwtexpui.globalkey.client.GlobalKey.keys.add ( set ) ; return new com.google.gwt.event.shared.HandlerRegistration ( ) { @ java.lang.Override public void removeHandler ( ) { com.google.gwtexpui.globalkey.client.GlobalKey.keys.remove ( set ) ; } } ; }

Target:
public static void dialog ( final com.google.gwt.user.client.ui.PopupPanel panel ) { com.google.gwtexpui.globalkey.client.GlobalKey.initEvents ( ) ; com.google.gwtexpui.globalkey.client.GlobalKey.initDialog ( ) ; assert panel.isVisible ( ) ; assert ( com.google.gwtexpui.globalkey.client.GlobalKey.active ) == ( com.google.gwtexpui.globalkey.client.GlobalKey.global ) ; com.google.gwtexpui.globalkey.client.GlobalKey.active = new com.google.gwtexpui.globalkey.client.GlobalKey.State ( panel ) ; com.google.gwtexpui.globalkey.client.GlobalKey.active.add ( new com.google.gwtexpui.globalkey.client.KeyCommand ( 0 , com.google.gwt.event.dom.client.KeyCodes.KEY_ESCAPE , Util.C.closeCurrentDialog ( ) ) { @ java.lang.Override public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { panel.hide ( ) ; } } ) ; panel.addCloseHandler ( com.google.gwtexpui.globalkey.client.GlobalKey.restoreGlobal ) ; }
Source:
protected java.lang.Void impl ( com.google.gerrit.server.util.RequestContext ctx ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.server.ReviewDb db = ctx.getReviewDbProvider ( ) . get ( ) ; com.google.gerrit.reviewdb.client.Change c = db.changes ( ) . get ( id ) ; indexerFactory.create ( executor , indexes ) . index ( db , c ) ; return null ; }

Target:
protected java.lang.Void impl ( com.google.gerrit.server.util.RequestContext ctx ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.server.ReviewDb db = ctx.getReviewDbProvider ( ) . get ( ) ; com.google.gerrit.reviewdb.client.Change c = notesFactory.create ( db , new com.google.gerrit.reviewdb.client.Project.NameKey ( event.getProjectName ( ) ) , id ) . getChange ( ) ; indexerFactory.create ( executor , indexes ) . index ( db , c ) ; return null ; }
Source:
private java.lang.Runnable upToChange ( final boolean openReplyBox ) { return new java.lang.Runnable ( ) { public void run ( ) { java.lang.String b = ( ( base ) != null ) ? java.lang.String.valueOf ( base.get ( ) ) : null ; java.lang.String rev = java.lang.String.valueOf ( revision.get ( ) ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId , rev ) , new com.google.gerrit.client.change.ChangeScreen2 ( changeId , b , rev , openReplyBox ) ) ; } } ; }

Target:
private java.lang.Runnable upToChange ( final boolean openReplyBox ) { return new java.lang.Runnable ( ) { public void run ( ) { if ( unsaved.isEmpty ( ) ) { goUpToChange ( openReplyBox ) ; } else { com.google.gerrit.client.rpc.CallbackGroup group = new com.google.gerrit.client.rpc.CallbackGroup ( ) ; saveAllDrafts ( group ) ; group.addFinal ( new com.google.gerrit.client.rpc.GerritCallback < java.lang.Void > ( ) { @ java.lang.Override public void onSuccess ( java.lang.Void result ) { goUpToChange ( openReplyBox ) ; } } ) . onSuccess ( null ) ; } } } ; }
Source:
private java.lang.String format ( final com.google.gerrit.server.git.WorkQueue.Task < ? > task ) { java.lang.String s = task.toString ( ) ; if ( ( s.length ( ) ) < ( taskNameWidth ) ) { return s ; } else { return s.substring ( 0 , taskNameWidth ) ; } }

Target:
public com.google.gerrit.sshd.commands.ShowQueue.QueueTaskInfo getTaskInfo ( com.google.gerrit.server.git.WorkQueue.Task < ? > task ) { return new com.google.gerrit.sshd.commands.ShowQueue.QueueTaskInfo ( task ) ; }
Source:
private static com.google.gwt.user.client.ui.Anchor anchor ( final java.lang.String text , final java.lang.String to ) { final com.google.gwt.user.client.ui.Anchor a = new com.google.gwt.user.client.ui.Anchor ( text , to ) ; a.setStyleName ( "gerrit-MenuItem" ) ; com.google.gwt.user.client.ui.Accessibility.setRole ( a.getElement ( ) , Accessibility.ROLE_MENUITEM ) ; return a ; }

Target:
private static com.google.gwt.user.client.ui.Anchor anchor ( final java.lang.String text , final java.lang.String to ) { final com.google.gwt.user.client.ui.Anchor a = new com.google.gwt.user.client.ui.Anchor ( text , to ) ; a.setStyleName ( com.google.gerrit.client.Gerrit.RESOURCES.css ( ) . menuItem ( ) ) ; com.google.gwt.user.client.ui.Accessibility.setRole ( a.getElement ( ) , Accessibility.ROLE_MENUITEM ) ; return a ; }