auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void deleteReviewerFromReviewableChangeByOwnerCcingSelfNotifyOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; setEmailStrategy ( sc.owner , EmailStrategy.CC_ON_OWN_COMMENTS ) ; removeReviewer ( sc , extraReviewer , NotifyHandling.OWNER ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . to ( sc.owner , extraReviewer ) . notTo ( extraCcer , sc.reviewer , sc.ccer ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( sc.starrer ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteReviewerFromReviewableChangeByOwnerCcingSelfNotifyOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChangeWithExtraReviewer ( ) ; setEmailStrategy ( sc.owner , EmailStrategy.CC_ON_OWN_COMMENTS ) ; removeReviewer ( sc , extraReviewer , NotifyHandling.OWNER ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . to ( sc.owner , extraReviewer ) . noOneElse ( ) ; }
Source:
void setReviewedByCurrentUser ( boolean reviewed ) { if ( ( fileList ) != null ) { fileList.updateReviewedStatus ( patchKey , reviewed ) ; } PatchUtil.DETAIL_SVC.setReviewedByCurrentUser ( patchKey , reviewed , new com.google.gwtjsonrpc.common.AsyncCallback < com.google.gwtjsonrpc.common.VoidResult > ( ) { @ java.lang.Override public void onFailure ( java.lang.Throwable arg0 ) { } @ java.lang.Override public void onSuccess ( com.google.gwtjsonrpc.common.VoidResult result ) { } } ) ; }

Target:
public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { reviewedPanels.go ( ) ; }
Source:
public void changeMessageWithMultipleParagraphs ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.setChangeMessage ( ( "Testing paragraph 1\n" + ( ( ( "\n" + "Testing paragraph 2\n" ) + "\n" ) + "Testing paragraph 3" ) ) ) ; update.commit ( ) ; assertBodyEquals ( ( "Update patch set 1\n" + ( ( ( ( ( ( ( "\n" + "Testing paragraph 1\n" ) + "\n" ) + "Testing paragraph 2\n" ) + "\n" ) + "Testing paragraph 3\n" ) + "\n" ) + "Patch-set: 1\n" ) ) , update.getRevision ( ) ) ; }

Target:
public void changeMessageWithMultipleParagraphs ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.setChangeMessage ( ( "Testing paragraph 1\n" + ( ( ( "\n" + "Testing paragraph 2\n" ) + "\n" ) + "Testing paragraph 3" ) ) ) ; update.commit ( ) ; assertBodyEquals ( ( "Update patch set 1\n" + ( ( ( ( ( ( ( "\n" + "Testing paragraph 1\n" ) + "\n" ) + "Testing paragraph 2\n" ) + "\n" ) + "Testing paragraph 3\n" ) + "\n" ) + "Patch-set: 1\n" ) ) , update.getResult ( ) ) ; }
Source:
public void resetHtml ( final com.google.gerrit.client.ui.FancyFlexTable.MyFlexTable myTable , final java.lang.String bodyHtml ) { final com.google.gwt.user.client.Element oldBody = getBodyElement ( myTable ) ; final com.google.gwt.user.client.Element newBody = com.google.gerrit.client.ui.FancyFlexTableImplIE6.parseBody ( bodyHtml ) ; assert newBody != null ; final com.google.gwt.user.client.Element tableElem = com.google.gwt.user.client.DOM.getParent ( oldBody ) ; com.google.gwt.user.client.DOM.removeChild ( tableElem , oldBody ) ; com.google.gerrit.client.ui.FancyFlexTableImplIE6.setBodyElement ( myTable , newBody ) ; com.google.gwt.user.client.DOM.appendChild ( tableElem , newBody ) ; }

Target:
public void resetHtml ( final com.google.gerrit.client.ui.FancyFlexTable.MyFlexTable myTable , final com.google.gwtexpui.safehtml.client.SafeHtml bodyHtml ) { final com.google.gwt.user.client.Element oldBody = getBodyElement ( myTable ) ; final com.google.gwt.user.client.Element newBody = com.google.gerrit.client.ui.FancyFlexTableImplIE6.parseBody ( bodyHtml ) ; assert newBody != null ; final com.google.gwt.user.client.Element tableElem = com.google.gwt.user.client.DOM.getParent ( oldBody ) ; com.google.gwt.user.client.DOM.removeChild ( tableElem , oldBody ) ; com.google.gerrit.client.ui.FancyFlexTableImplIE6.setBodyElement ( myTable , newBody ) ; com.google.gwt.user.client.DOM.appendChild ( tableElem , newBody ) ; }
Source:
public void run ( ) { try { future.get ( ) ; doneTask.update ( 1 ) ; } catch ( java.util.concurrent.ExecutionException | java.lang.InterruptedException e ) { fail ( e ) ; } catch ( java.lang.RuntimeException e ) { failAndThrow ( e ) ; } catch ( java.lang.Error e ) { failAndThrow ( e ) ; } }

Target:
public void run ( ) { try { future.get ( ) ; doneTask.update ( 1 ) ; } catch ( java.util.concurrent.ExecutionException | java.lang.InterruptedException e ) { if ( ( e.getCause ( ) ) instanceof org.eclipse.jgit.errors.RepositoryNotFoundException ) { noRepo ( ( ( org.eclipse.jgit.errors.RepositoryNotFoundException ) ( e.getCause ( ) ) ) ) ; } else { fail ( e ) ; } } catch ( java.lang.RuntimeException e ) { failAndThrow ( e ) ; } catch ( java.lang.Error e ) { failAndThrow ( e ) ; } }
Source:
private java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > visibleTags ( ) { }

Target:
private java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > visibleTags ( com.google.gerrit.server.project.ProjectControl pctl , org.eclipse.jgit.lib.Repository repo , java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > tags ) { return refFilterFactory.create ( pctl.getProjectState ( ) , repo ) . setShowMetadata ( false ) . filter ( tags , true ) ; }
Source:
private void formatDest ( ) { appendText ( ( "Change " + ( change.getId ( ) ) ) ) ; appendText ( ( ( " (patch set " + ( patchSet.getPatchSetId ( ) ) ) + ")" ) ) ; appendText ( " for " ) ; appendText ( change.getDest ( ) . getShortName ( ) ) ; appendText ( " in " ) ; appendText ( projectName ) ; appendText ( ":\n" ) ; }

Target:
private void formatDest ( ) { appendText ( ( "Change " + ( change.getKey ( ) . abbreviate ( ) ) ) ) ; appendText ( ( ( " (patch set " + ( patchSet.getPatchSetId ( ) ) ) + ")" ) ) ; appendText ( " for " ) ; appendText ( change.getDest ( ) . getShortName ( ) ) ; appendText ( " in " ) ; appendText ( projectName ) ; appendText ( ":\n" ) ; }
Source:
private com.google.common.base.Optional < javax.crypto.SecretKey > generateKey ( ) { try { javax.crypto.KeyGenerator generator = javax.crypto.KeyGenerator.getInstance ( com.googlesource.gerrit.plugins.lfs.fs.LfsFsRequestAuthorizer.ALGORITHM ) ; generator.init ( 128 , rndm ) ; return com.google.common.base.Optional.of ( generator.generateKey ( ) ) ; } catch ( java.security.NoSuchAlgorithmException e ) { com.googlesource.gerrit.plugins.lfs.fs.LfsFsRequestAuthorizer.log.error ( "Generating key failed with error" , e ) ; } return com.google.common.base.Optional.absent ( ) ; }

Target:
private javax.crypto.SecretKey generateKey ( ) { try { javax.crypto.KeyGenerator generator = javax.crypto.KeyGenerator.getInstance ( com.googlesource.gerrit.plugins.lfs.fs.LfsFsRequestAuthorizer.ALGORITHM ) ; generator.init ( 128 , rndm ) ; return generator.generateKey ( ) ; } catch ( java.security.NoSuchAlgorithmException e ) { com.googlesource.gerrit.plugins.lfs.fs.LfsFsRequestAuthorizer.log.error ( "Generating key failed with error" , e ) ; throw new java.lang.RuntimeException ( e ) ; } }
Source:
static com.google.gerrit.server.index.QueryOptions convertOptions ( com.google.gerrit.server.index.QueryOptions opts ) { int backendLimit = opts.config ( ) . maxLimit ( ) ; int limit = com.google.common.primitives.Ints.saturatedCast ( ( ( ( long ) ( opts.limit ( ) ) ) + ( opts.start ( ) ) ) ) ; limit = java.lang.Math.min ( limit , backendLimit ) ; return com.google.gerrit.server.index.change.IndexedChangeQuery.createOptions ( opts.config ( ) , 0 , limit , opts.fields ( ) ) ; }

Target:
static com.google.gerrit.server.index.QueryOptions convertOptions ( com.google.gerrit.server.index.QueryOptions opts ) { opts = opts.convertForBackend ( ) ; return com.google.gerrit.server.index.change.IndexedChangeQuery.createOptions ( opts.config ( ) , opts.start ( ) , opts.limit ( ) , opts.fields ( ) ) ; }
Source:
private static boolean isUnifiedPatchLink ( final com.google.gerrit.reviewdb.client.Patch patch ) { return ( patch.getPatchType ( ) . equals ( PatchType.BINARY ) ) || ( ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) && ( com.google.gerrit.client.Gerrit.getUserAccount ( ) . getGeneralPreferences ( ) . getDiffView ( ) . equals ( DiffView.UNIFIED_DIFF ) ) ) ; }

Target:
private static boolean isUnifiedPatchLink ( final com.google.gerrit.reviewdb.client.Patch patch ) { return ( patch.getPatchType ( ) . equals ( PatchType.BINARY ) ) || ( ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) && ( com.google.gerrit.client.Gerrit.getUserPreferences ( ) . diffView ( ) . equals ( DiffView.UNIFIED_DIFF ) ) ) ; }
Source:
protected void populate ( final int row , final com.google.gerrit.reviewdb.client.Project k ) { table.setText ( row , 1 , k.getName ( ) ) ; table.setText ( row , 2 , k.getDescription ( ) ) ; setRowItem ( row , k ) ; }

Target:
protected void populate ( final int row , final com.google.gerrit.client.projects.ProjectInfo k ) { table.setText ( row , 1 , k.name ( ) ) ; table.setText ( row , 2 , k.description ( ) ) ; setRowItem ( row , k ) ; }
Source:
private void removeRunAs ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; com.google.gerrit.server.project.testing.Util.remove ( cfg , GlobalCapability.RUN_AS , systemGroupBackend.getGroup ( com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS ) . getUUID ( ) ) ; saveProjectConfig ( allProjects , cfg ) ; }

Target:
private void removeRunAs ( ) throws java.lang.Exception { com.google.gerrit.server.project.ProjectConfig cfg = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; com.google.gerrit.server.project.testing.Util.remove ( cfg , GlobalCapability.RUN_AS , systemGroupBackend.getGroup ( com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS ) . getUUID ( ) ) ; saveProjectConfig ( allProjects , cfg ) ; }
Source:
public void destroy ( ) { eventListenerRegistration.remove ( ) ; final boolean exit ; synchronized ( taskLock ) { if ( ( task ) != null ) { task.cancel ( true ) ; exit = false ; } else { exit = ! ( done ) ; } done = true ; } if ( exit ) { onExit ( 0 ) ; } }

Target:
public void destroy ( ) { removeEventListenerRegistration ( ) ; final boolean exit ; synchronized ( taskLock ) { if ( ( task ) != null ) { task.cancel ( true ) ; exit = false ; } else { exit = ! ( done ) ; } done = true ; } if ( exit ) { onExit ( 0 ) ; } }
Source:
public void run ( ) { renderSkips ( context ) ; }

Target:
public void run ( ) { cmA.setOption ( "mode" , ( b ? getContentType ( diff.meta_a ( ) ) : null ) ) ; cmB.setOption ( "mode" , ( b ? getContentType ( diff.meta_b ( ) ) : null ) ) ; }
Source:
public void writeNoChanges ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , modifier.createEdit ( change , ps ) ) ; try { modifier.modifyFile ( editUtil.byChange ( change ) . get ( ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME , com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_OLD ) ; org.junit.Assert.fail ( ) ; } catch ( com.google.gerrit.server.project.InvalidChangeOperationException e ) { org.junit.Assert.assertEquals ( "no changes were made" , e.getMessage ( ) ) ; } }

Target:
public void writeNoChanges ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( modifier.createEdit ( change , ps ) ) . isEqualTo ( RefUpdate.Result.NEW ) ; try { modifier.modifyFile ( editUtil.byChange ( change ) . get ( ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME , com.google.gerrit.acceptance.RestSession.newRawInput ( com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_OLD ) ) ; org.junit.Assert.fail ( ) ; } catch ( com.google.gerrit.server.project.InvalidChangeOperationException e ) { com.google.common.truth.Truth.assertThat ( e.getMessage ( ) ) . isEqualTo ( "no changes were made" ) ; } }
Source:
public void execute ( ) { if ( ( cmA ) != null ) { cmA.setOption ( "viewportMargin" , 10 ) ; } if ( ( cmB ) != null ) { cmB.setOption ( "viewportMargin" , 10 ) ; } }

Target:
public void run ( ) { net.codemirror.lib.CodeMirror.Viewport fromTo = cm.getViewport ( ) ; int size = ( ( fromTo.getTo ( ) ) - ( fromTo.getFrom ( ) ) ) + 1 ; if ( ( cm.getOldViewportSize ( ) ) == size ) { return ; } cm.setOldViewportSize ( size ) ; diffTable.sidePanel.adjustGutters ( cmB ) ; }
Source:
protected void execStream ( final java.io.InputStream in , final java.lang.String p ) { try { runMethod0 ( console , shell , "execfile" , new java.lang.Class [ ] { java.io.InputStream.class , java.lang.String.class } , new java.lang.Object [ ] { in , p } ) ; } catch ( java.lang.reflect.InvocationTargetException e ) { com.google.gerrit.pgm.JythonShell.log.error ( ( ( "Exception occured while loading " + p ) + " : " ) , e ) ; } }

Target:
protected void execStream ( final java.io.InputStream in , final java.lang.String p ) { try { runMethod0 ( console , shell , "execfile" , new java.lang.Class [ ] { java.io.InputStream.class , java.lang.String.class } , new java.lang.Object [ ] { in , p } ) ; } catch ( java.lang.reflect.InvocationTargetException e ) { com.google.gerrit.pgm.JythonShell.log.error ( ( ( "Exception occurred while loading " + p ) + " : " ) , e ) ; } }
Source:
private java.util.List < com.google.gerrit.reviewdb.RefRight > resolveOwnerGroups ( final java.util.List < com.google.gerrit.reviewdb.RefRight > refRights ) { final java.util.List < com.google.gerrit.reviewdb.RefRight > resolvedRefRights = new java.util.ArrayList < com.google.gerrit.reviewdb.RefRight > ( refRights.size ( ) ) ; for ( final com.google.gerrit.reviewdb.RefRight refRight : refRights ) { resolvedRefRights.addAll ( resolveOwnerGroups ( refRight ) ) ; } return resolvedRefRights ; }

Target:
private java.util.List < com.google.gerrit.common.data.PermissionRule > access ( java.lang.String permissionName ) { java.util.List < com.google.gerrit.common.data.PermissionRule > r = permissions ( ) . get ( permissionName ) ; return r != null ? r : java.util.Collections.< com.google.gerrit.common.data.PermissionRule > emptyList ( ) ; }
Source:
private static org.eclipse.jgit.util.TemporaryBuffer.Heap base64 ( com.google.gerrit.extensions.restapi.BinaryResult bin ) throws java.io.IOException { int len = ( ( int ) ( bin.getContentLength ( ) ) ) ; int max = 4 * ( com.google.common.math.IntMath.divide ( len , 3 , java.math.RoundingMode.CEILING ) ) ; org.eclipse.jgit.util.TemporaryBuffer.Heap buf = com.google.gerrit.httpd.restapi.RestApiServlet.heap ( max ) ; java.io.OutputStream encoded = com.google.common.io.BaseEncoding.base64 ( ) . encodingStream ( new java.io.OutputStreamWriter ( buf , com.google.common.base.Charsets.ISO_8859_1 ) ) ; bin.writeTo ( encoded ) ; encoded.close ( ) ; return buf ; }

Target:
private static com.google.gerrit.extensions.restapi.BinaryResult base64 ( com.google.gerrit.extensions.restapi.BinaryResult bin ) throws java.io.IOException { int max = 4 * ( com.google.common.math.IntMath.divide ( ( ( int ) ( bin.getContentLength ( ) ) ) , 3 , java.math.RoundingMode.CEILING ) ) ; org.eclipse.jgit.util.TemporaryBuffer.Heap buf = com.google.gerrit.httpd.restapi.RestApiServlet.heap ( max ) ; java.io.OutputStream encoded = com.google.common.io.BaseEncoding.base64 ( ) . encodingStream ( new java.io.OutputStreamWriter ( buf , com.google.common.base.Charsets.ISO_8859_1 ) ) ; bin.writeTo ( encoded ) ; encoded.close ( ) ; return com.google.gerrit.httpd.restapi.RestApiServlet.asBinaryResult ( buf ) ; }
Source:
private java.util.Set < com.google.gerrit.reviewdb.Account > listAccounts ( final com.google.gerrit.reviewdb.AccountGroup.UUID groupUUID , final java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > seen ) throws com.google.gerrit.common.errors.NoSuchGroupException , com.google.gerrit.server.project.NoSuchProjectException , com.google.gwtorm.client.OrmException { if ( AccountGroup.PROJECT_OWNERS.equals ( groupUUID ) ) { return getProjectOwners ( seen ) ; } else { return getGroupMembers ( groupCache.get ( groupUUID ) , seen ) ; } }

Target:
private java.util.Set < com.google.gerrit.reviewdb.Account > listAccounts ( final com.google.gerrit.reviewdb.AccountGroup.UUID groupUUID , final com.google.gerrit.reviewdb.Project.NameKey project , final java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > seen ) throws com.google.gerrit.common.errors.NoSuchGroupException , com.google.gerrit.server.project.NoSuchProjectException , com.google.gwtorm.client.OrmException { if ( AccountGroup.PROJECT_OWNERS.equals ( groupUUID ) ) { return getProjectOwners ( project , seen ) ; } else { return getGroupMembers ( groupCache.get ( groupUUID ) , project , seen ) ; } }
Source:
public void onFailure ( final java.lang.Throwable caught ) { if ( ( rpcSequence ) == rpcseq ) { if ( ( isNoDifferences ( caught ) ) && ( ! isFirst ) ) { historyTable.enableAll ( true ) ; showPatch ( false ) ; } else { super . onFailure ( caught ) ; } } }

Target:
public void onFailure ( java.lang.Throwable caught ) { if ( ( ! ( isNoSuchEntity ( caught ) ) ) && ( ( rpcSequence ) == rpcseq ) ) { super . onFailure ( caught ) ; } }
Source:
public void addChangeMessage ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeUpdate update , com.google.gerrit.reviewdb.client.ChangeMessage changeMessage ) throws com.google.gwtorm.server.OrmException { update.setChangeMessage ( changeMessage.getMessage ( ) ) ; db.changeMessages ( ) . insert ( java.util.Collections.singleton ( changeMessage ) ) ; }

Target:
public void addChangeMessage ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeUpdate update , com.google.gerrit.reviewdb.client.ChangeMessage changeMessage ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkState ( java.util.Objects.equals ( changeMessage.getAuthor ( ) , update.getUser ( ) . getAccountId ( ) ) , "cannot store change message of %s in update of %s" , changeMessage.getAuthor ( ) , update.getUser ( ) . getAccountId ( ) ) ; update.setChangeMessage ( changeMessage.getMessage ( ) ) ; db.changeMessages ( ) . insert ( java.util.Collections.singleton ( changeMessage ) ) ; }
Source:
private void add ( com.google.gerrit.server.mail.ProjectWatch.Watchers matching , com.google.gerrit.reviewdb.client.AccountProjectWatch w ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.IdentifiedUser user = args.identifiedUserFactory.create ( args.db , w.getAccountId ( ) ) ; try { if ( filterMatch ( user , w.getFilter ( ) ) ) { matching.bcc.accounts.add ( w.getAccountId ( ) ) ; } } catch ( com.google.gerrit.server.query.QueryParseException e ) { } }

Target:
private boolean add ( com.google.gerrit.server.mail.ProjectWatch.Watchers matching , com.google.gerrit.reviewdb.client.AccountProjectWatch w , com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType type ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.IdentifiedUser user = args.identifiedUserFactory.create ( args.db , w.getAccountId ( ) ) ; try { if ( filterMatch ( user , w.getFilter ( ) ) ) { if ( w.isNotify ( type ) ) { matching.bcc.accounts.add ( w.getAccountId ( ) ) ; } return true ; } } catch ( com.google.gerrit.server.query.QueryParseException e ) { } return false ; }
Source:
public void testIsEnabledRefNoParentMatchingBranchMiddleEnabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/foo.*" , "^refs/heads/test.*" , "^refs/heads/baz.*" } ; setupIsEnabled ( "true" , null , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( "testProject" , "refs/heads/testBranch" ) ) ; }

Target:
public void testIsEnabledRefNoParentMatchingBranchMiddleEnforced ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/foo.*" , "^refs/heads/test.*" , "^refs/heads/baz.*" } ; setupIsEnabled ( "enforced" , null , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectNK = new com.google.gerrit.reviewdb.client.Project.NameKey ( "testProject" ) ; assertTrue ( itsConfig.isEnabled ( projectNK , "refs/heads/testBranch" ) ) ; }
Source:
private static java.lang.String formatAccount ( com.google.gerrit.client.account.AccountInfo account ) { java.lang.StringBuilder b = new java.lang.StringBuilder ( ) ; b.append ( com.google.gerrit.client.FormatUtil.name ( account ) ) ; b.append ( " (" ) ; b.append ( account._accountId ( ) ) ; b.append ( ")" ) ; return b.toString ( ) ; }

Target:
private static java.lang.String formatAccount ( com.google.gerrit.client.info.AccountInfo account ) { java.lang.StringBuilder b = new java.lang.StringBuilder ( ) ; b.append ( com.google.gerrit.client.FormatUtil.name ( account ) ) ; b.append ( " (" ) ; b.append ( account._accountId ( ) ) ; b.append ( ")" ) ; return b.toString ( ) ; }
Source:
public void commentOnReviewableWipChangeByOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; review ( sc.owner , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED ) ; assertThat ( sender ) . notSent ( ) ; }

Target:
public void commentOnReviewableWipChangeByOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; review ( sc.owner , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED ) ; assertThat ( sender ) . sent ( "comment" , sc ) . notTo ( 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 ) ; }
Source:
public void testUnblockMoreSpecificRef_Fails ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/master" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertFalse ( "u can't push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }

Target:
public void testUnblockLargerScope_Fails ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/master" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.plugin.client.rpc.NoContent > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.plugin.client.rpc.NoContent noContent ) { label.setText ( "" ) ; label.setVisible ( false ) ; delete.setVisible ( false ) ; } HEAD ( ) { } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { new com.google.gerrit.plugin.client.rpc.RestApi ( "config" ) . id ( "server" ) . view ( com.google.gerrit.plugin.client.Plugin.get ( ) . getPluginName ( ) , "serviceusers" ) . id ( serviceUser ) . view ( "password.http" ) . delete ( new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.plugin.client.rpc.NoContent > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.plugin.client.rpc.NoContent noContent ) { label.setText ( "" ) ; label.setVisible ( false ) ; delete.setVisible ( false ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }
Source:
public boolean updateChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet ps = psUtil.get ( ctx.getDb ( ) , ctx.getNotes ( ) , psId ) ; psUtil.setGroups ( ctx.getDb ( ) , ctx.getUpdate ( psId ) , ps , groups ) ; return true ; }

Target:
public boolean updateChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet ps = psUtil.get ( ctx.getDb ( ) , ctx.getNotes ( ) , psId ) ; psUtil.setGroups ( ctx.getDb ( ) , ctx.getUpdate ( psId ) , ps , com.google.common.collect.ImmutableList.< java.lang.String > of ( ) ) ; return true ; }
Source:
public void testSubscriptionWithoutServerSetting ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < ? > superRepo = createProjectWithPush ( "super-project" ) ; org.eclipse.jgit.junit.TestRepository < ? > subRepo = createProjectWithPush ( "subscribed-to-project" ) ; createSubmoduleSubscription ( superRepo , "master" , "subscribed-to-project" , "master" ) ; pushChangeTo ( subRepo , "master" ) ; com.google.common.truth.Truth.assertThat ( hasSubmodule ( superRepo , "master" , "subscribed-to-project" ) ) . isFalse ( ) ; }

Target:
public void testSubscriptionWithoutGlobalServerSetting ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < ? > superRepo = createProjectWithPush ( "super-project" ) ; org.eclipse.jgit.junit.TestRepository < ? > subRepo = createProjectWithPush ( "subscribed-to-project" ) ; allowSubmoduleSubscription ( "subscribed-to-project" , "refs/heads/master" , "super-project" , "refs/heads/master" ) ; createSubmoduleSubscription ( superRepo , "master" , "subscribed-to-project" , "master" ) ; pushChangeTo ( subRepo , "master" ) ; com.google.common.truth.Truth.assertThat ( hasSubmodule ( superRepo , "master" , "subscribed-to-project" ) ) . isFalse ( ) ; }
Source:
private void checkImpl ( ) { com.google.common.base.Preconditions.checkState ( ( ! ( notesMigration.readChanges ( ) ) ) , "ConsistencyChecker for notedb not yet implemented" ) ; checkOwner ( ) ; checkCurrentPatchSetEntity ( ) ; if ( ! ( openRepo ( ) ) ) { return ; } if ( ! ( checkPatchSets ( ) ) ) { return ; } checkMerged ( ) ; }

Target:
private void checkImpl ( ) { com.google.common.base.Preconditions.checkState ( ( ! ( notesMigration.readChanges ( ) ) ) , "ConsistencyChecker for NoteDb not yet implemented" ) ; checkOwner ( ) ; checkCurrentPatchSetEntity ( ) ; if ( ! ( openRepo ( ) ) ) { return ; } if ( ! ( checkPatchSets ( ) ) ) { return ; } checkMerged ( ) ; }
Source:
private com.google.gwt.user.client.Element getRow ( int row ) { if ( ( ( startRow ) <= row ) && ( row < ( ( startRow ) + ( body.getChildCount ( ) ) ) ) ) { return body.getChild ( ( row - ( startRow ) ) ) . cast ( ) ; } return null ; }

Target:
private com.google.gwt.dom.client.Element getRow ( int row ) { if ( ( ( startRow ) <= row ) && ( row < ( ( startRow ) + ( body.getChildCount ( ) ) ) ) ) { return body.getChild ( ( row - ( startRow ) ) ) . cast ( ) ; } return null ; }
Source:
public void getRelatedNoResult ( ) throws java.io.IOException , java.lang.Exception , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.PushOneCommit push = new com.google.gerrit.acceptance.git.PushOneCommit ( db , admin.getIdent ( ) ) ; com.google.gerrit.reviewdb.client.PatchSet.Id ps = push.to ( git , "refs/for/master" ) . getPatchSetId ( ) ; java.util.List < com.google.gerrit.acceptance.server.change.ChangeAndCommit > related = getRelated ( ps ) ; org.junit.Assert.assertEquals ( 0 , related.size ( ) ) ; }

Target:
public void getRelatedNoResult ( ) throws java.io.IOException , java.lang.Exception , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) ) ; com.google.gerrit.reviewdb.client.PatchSet.Id ps = push.to ( git , "refs/for/master" ) . getPatchSetId ( ) ; java.util.List < com.google.gerrit.acceptance.server.change.ChangeAndCommit > related = getRelated ( ps ) ; org.junit.Assert.assertEquals ( 0 , related.size ( ) ) ; }
Source:
public void queryChangesMultipleTerms ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r1 = createChange ( ) ; createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = query ( ( "status:open " + ( r1.getChangeId ( ) ) ) ) ; org.junit.Assert.assertEquals ( r1.getChangeId ( ) , com.google.common.collect.Iterables.getOnlyElement ( results ) . changeId ) ; }

Target:
public void queryChangesOneTerm ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r1 = createChange ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r2 = createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = query ( "status:open" ) ; com.google.common.truth.Truth.assertThat ( results.size ( ) ) . is ( 2 ) ; com.google.common.truth.Truth.assertThat ( results.get ( 0 ) . changeId ) . isEqualTo ( r2.getChangeId ( ) ) ; com.google.common.truth.Truth.assertThat ( results.get ( 1 ) . changeId ) . isEqualTo ( r1.getChangeId ( ) ) ; }
Source:
private void save ( com.google.gerrit.server.git.ProjectConfig pc ) throws java.lang.Exception { try ( com.google.gerrit.server.git.MetaDataUpdate md = metaDataUpdateFactory.create ( pc.getProject ( ) . getNameKey ( ) , user ) ) { pc.commit ( md ) ; projectCache.evict ( pc.getProject ( ) . getNameKey ( ) ) ; } }

Target:
private void save ( com.google.gerrit.server.git.ProjectConfig pc ) throws java.lang.Exception { try ( com.google.gerrit.server.git.meta.MetaDataUpdate md = metaDataUpdateFactory.create ( pc.getProject ( ) . getNameKey ( ) , user ) ) { pc.commit ( md ) ; projectCache.evict ( pc.getProject ( ) . getNameKey ( ) ) ; } }
Source:
public java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > starredBy ( ) throws com.google.gwtorm.server.OrmException { if ( ( starredByUser ) == null ) { starredByUser = com.google.common.base.Preconditions.checkNotNull ( starredChangesUtil ) . byChange ( legacyId , StarredChangesUtil.DEFAULT_LABEL ) ; } return starredByUser ; }

Target:
public java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > starredBy ( ) throws com.google.gwtorm.server.OrmException { if ( ( starredByUser ) == null ) { if ( ! ( lazyLoad ) ) { return java.util.Collections.emptySet ( ) ; } starredByUser = com.google.common.base.Preconditions.checkNotNull ( starredChangesUtil ) . byChange ( legacyId , StarredChangesUtil.DEFAULT_LABEL ) ; } return starredByUser ; }
Source:
public com.google.gerrit.server.data.PatchSetAttribute get ( ) { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( change.getProject ( ) ) ; org.eclipse.jgit.revwalk.RevWalk revWalk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return eventFactory.asPatchSetAttribute ( revWalk , change , patchSet ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } }

Target:
private com.google.gerrit.server.data.PatchSetAttribute patchSetAttribute ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet patchSet ) { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( change.getProject ( ) ) ; org.eclipse.jgit.revwalk.RevWalk revWalk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return eventFactory.asPatchSetAttribute ( revWalk , change , patchSet ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } }
Source:
public int weigh ( com.google.gerrit.server.change.ChangeKindCacheImpl.Key key , com.google.gerrit.server.change.ChangeKind changeKind ) { return ( ( 16 + ( 2 * 36 ) ) + ( 2 * ( key.strategyName.length ( ) ) ) ) + ( 2 * ( changeKind.name ( ) . length ( ) ) ) ; }

Target:
public int weigh ( com.google.gerrit.server.change.ChangeKindCacheImpl.Key key , com.google.gerrit.extensions.client.ChangeKind changeKind ) { return ( ( 16 + ( 2 * 36 ) ) + ( 2 * ( key.strategyName.length ( ) ) ) ) + ( 2 * ( changeKind.name ( ) . length ( ) ) ) ; }
Source:
public static void deleteAssignee ( int id , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.AccountInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.change ( id ) . view ( "assignee" ) . delete ( cb ) ; }

Target:
public static void restore ( @ com.google.gerrit.common.Nullable java.lang.String project , int id , java.lang.String msg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.MessageInput input = com.google.gerrit.client.changes.ChangeApi.MessageInput.create ( ) ; input.message ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( msg ) ) ; com.google.gerrit.client.changes.ChangeApi.call ( project , id , "restore" ) . post ( input , cb ) ; }
Source:
public int compare ( com.google.gerrit.client.diff.FileInfo a , com.google.gerrit.client.diff.FileInfo b ) { if ( Patch.COMMIT_MSG.equals ( a.path ( ) ) ) { return - 1 ; } else if ( Patch.COMMIT_MSG.equals ( b.path ( ) ) ) { return 1 ; } return a.path ( ) . compareTo ( b.path ( ) ) ; }

Target:
void setValue ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.diff.FileInfo > fileMap , java.sql.Timestamp myLastReply , com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > comments , com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > drafts ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.diff.FileInfo > list = fileMap.values ( ) ; com.google.gerrit.client.diff.FileInfo.sortFileInfoByPath ( list ) ; com.google.gerrit.client.change.FileTable.DisplayCommand cmd = new com.google.gerrit.client.change.FileTable.DisplayCommand ( fileMap , list , myLastReply , comments , drafts ) ; if ( cmd.execute ( ) ) { cmd.showProgressBar ( ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleIncremental ( cmd ) ; } }
Source:
public static com.google.gerrit.extensions.client.DiffPreferencesInfo updateDefaultDiffPreferences ( com.google.gerrit.server.git.MetaDataUpdate md , com.google.gerrit.extensions.client.DiffPreferencesInfo input ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.account.Preferences.VersionedDefaultPreferences defaultPrefs = new com.google.gerrit.server.account.Preferences.VersionedDefaultPreferences ( ) ; defaultPrefs.load ( md ) ; com.google.gerrit.server.config.ConfigUtil.storeSection ( defaultPrefs.getConfig ( ) , UserConfigSections.DIFF , null , input , com.google.gerrit.extensions.client.DiffPreferencesInfo.defaults ( ) ) ; defaultPrefs.commit ( md ) ; return com.google.gerrit.server.account.Preferences.parseDiffPreferences ( defaultPrefs.getConfig ( ) , null , null ) ; }

Target:
public static com.google.gerrit.extensions.client.DiffPreferencesInfo updateDefaultDiffPreferences ( com.google.gerrit.server.git.meta.MetaDataUpdate md , com.google.gerrit.extensions.client.DiffPreferencesInfo input ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.account.Preferences.VersionedDefaultPreferences defaultPrefs = new com.google.gerrit.server.account.Preferences.VersionedDefaultPreferences ( ) ; defaultPrefs.load ( md ) ; com.google.gerrit.server.config.ConfigUtil.storeSection ( defaultPrefs.getConfig ( ) , UserConfigSections.DIFF , null , input , com.google.gerrit.extensions.client.DiffPreferencesInfo.defaults ( ) ) ; defaultPrefs.commit ( md ) ; return com.google.gerrit.server.account.Preferences.parseDiffPreferences ( defaultPrefs.getConfig ( ) , null , null ) ; }
Source:
private static java.lang.reflect.Field getParameterField ( java.lang.Class < ? > clazz ) { java.util.List < java.lang.reflect.Field > fields = com.google.common.collect.Lists.newArrayListWithExpectedSize ( 1 ) ; for ( java.lang.reflect.Field f : clazz.getFields ( ) ) { if ( ( f.getAnnotation ( com.google.gerrit.testutil.ConfigSuite.Parameter.class ) ) != null ) { fields.add ( f ) ; } } com.google.common.base.Preconditions.checkArgument ( ( ( fields.size ( ) ) == 1 ) , "expected 1 @ConfigSuite.Parameter field, found: %s" , fields ) ; return fields.get ( 0 ) ; }

Target:
private static java.util.List < org.junit.runner.Runner > runnersFor ( java.lang.Class < ? > clazz ) { java.lang.reflect.Method defaultConfig = com.google.gerrit.testutil.ConfigSuite.getDefaultConfig ( clazz ) ; java.util.List < java.lang.reflect.Method > configs = com.google.gerrit.testutil.ConfigSuite.getConfigs ( clazz ) ; java.lang.reflect.Field parameterField = com.google.gerrit.testutil.ConfigSuite.getOnlyField ( clazz , com.google.gerrit.testutil.ConfigSuite.Parameter.class ) ; com.google.common.base.Preconditions.checkArgument ( ( parameterField != null ) , "No @ConfigSuite.Field found" ) ; java.lang.reflect.Field nameField = com.google.gerrit.testutil.ConfigSuite.getOnlyField ( clazz , com.google.gerrit.testutil.ConfigSuite.Name.class ) ; java.util.List < org.junit.runner.Runner > result = com.google.common.collect.Lists.newArrayListWithCapacity ( ( ( configs.size ( ) ) + 1 ) ) ; try { result.add ( new com.google.gerrit.testutil.ConfigSuite.ConfigRunner ( clazz , parameterField , nameField , null , defaultConfig ) ) ; for ( java.lang.reflect.Method m : configs ) { result.add ( new com.google.gerrit.testutil.ConfigSuite.ConfigRunner ( clazz , parameterField , nameField , m.getName ( ) , m ) ) ; } return result ; } catch ( org.junit.runners.model.InitializationError e ) { java.lang.System.err.println ( "Errors initializing runners:" ) ; for ( java.lang.Throwable t : e.getCauses ( ) ) { t.printStackTrace ( ) ; } throw new java.lang.RuntimeException ( e ) ; } }
Source:
public java.lang.String getLine ( final int i ) { final int s = lines.get ( ( i + 1 ) ) ; int e = lines.get ( ( i + 2 ) ) ; if ( ( content [ ( e - 1 ) ] ) == '\n' ) { e -- ; } return org.eclipse.jgit.util.RawParseUtils.decode ( Constants.CHARSET , content , s , e ) ; }

Target:
private int getLineEnd ( final int i ) { return lines.get ( ( i + 2 ) ) ; }
Source:
private void assertApproval ( com.google.gerrit.acceptance.PushOneCommit.Result r , int expected ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo c = get ( r.getChangeId ( ) , com.google.gerrit.extensions.common.ListChangesOption.DETAILED_LABELS ) ; com.google.gerrit.extensions.common.LabelInfo cr = c.labels.get ( "Code-Review" ) ; org.junit.Assert.assertEquals ( 1 , cr.all.size ( ) ) ; org.junit.Assert.assertEquals ( "Administrator" , cr.all.get ( 0 ) . name ) ; org.junit.Assert.assertEquals ( expected , cr.all.get ( 0 ) . value.intValue ( ) ) ; }

Target:
private void merge ( com.google.gerrit.acceptance.PushOneCommit.Result r ) throws java.lang.Exception { revision ( r ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) ) ; revision ( r ) . submit ( ) ; org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ; try { org.junit.Assert.assertEquals ( r.getCommitId ( ) , repo.getRef ( "refs/heads/master" ) . getObjectId ( ) ) ; } finally { repo.close ( ) ; } }
Source:
private void fireEvent ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , com.google.gerrit.common.Event event ) { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( branchName , holder.user ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }

Target:
public void doClaSignupHook ( com.google.gerrit.reviewdb.client.Account account , java.lang.String claName ) { if ( ! ( claSignedHook.isPresent ( ) ) ) { return ; } if ( account != null ) { java.util.List < java.lang.String > args = new java.util.ArrayList < > ( ) ; addArg ( args , "--submitter" , getDisplayName ( account ) ) ; addArg ( args , "--user-id" , account.getId ( ) . toString ( ) ) ; addArg ( args , "--cla-name" , claName ) ; runHook ( claSignedHook , args ) ; } }
Source:
public void finishIndex ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.storage.file.FileBasedConfig cfg = new org.eclipse.jgit.storage.file.FileBasedConfig ( com.google.gerrit.solr.IndexVersionCheck.solrIndexConfig ( sitePaths ) , org.eclipse.jgit.util.FS.detect ( ) ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.Integer > e : com.google.gerrit.solr.IndexVersionCheck.SCHEMA_VERSIONS.entrySet ( ) ) { cfg.setInt ( "index" , e.getKey ( ) , "schemaVersion" , e.getValue ( ) ) ; } cfg.save ( ) ; }

Target:
public void markReady ( ) throws java.io.IOException { org.eclipse.jgit.storage.file.FileBasedConfig cfg = new org.eclipse.jgit.storage.file.FileBasedConfig ( com.google.gerrit.solr.IndexVersionCheck.solrIndexConfig ( sitePaths ) , org.eclipse.jgit.util.FS.detect ( ) ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.Integer > e : com.google.gerrit.solr.IndexVersionCheck.SCHEMA_VERSIONS.entrySet ( ) ) { cfg.setInt ( "index" , e.getKey ( ) , "schemaVersion" , e.getValue ( ) ) ; } cfg.save ( ) ; }
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 = changeDataFactory.create ( db.get ( ) , 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 ( ) ) ; return format ( cd , com.google.common.base.Optional.of ( rsrc.getPatchSet ( ) . getId ( ) ) ) ; }
Source:
private static java.lang.String quotedPhrase ( final java.lang.String name ) { for ( int i = 0 ; i < ( name.length ( ) ) ; i ++ ) { final char c = name.charAt ( i ) ; if ( ( ( c < ' ' ) || ( 127 <= c ) ) || ( ( com.google.gerrit.server.mail.Address.MUST_QUOTE_NAME.indexOf ( c ) ) != ( - 1 ) ) ) { return com.google.gerrit.server.mail.Address.wrapInQuotes ( name ) ; } } return name ; }

Target:
private static java.lang.String quotedPhrase ( final java.lang.String name ) throws java.io.UnsupportedEncodingException { if ( com.google.gerrit.server.mail.EmailHeader.needsQuotedPrintable ( name ) ) { return com.google.gerrit.server.mail.EmailHeader.quotedPrintable ( name ) ; } for ( int i = 0 ; i < ( name.length ( ) ) ; i ++ ) { final char c = name.charAt ( i ) ; if ( ( com.google.gerrit.server.mail.Address.MUST_QUOTE_NAME.indexOf ( c ) ) != ( - 1 ) ) { return com.google.gerrit.server.mail.Address.wrapInQuotes ( name ) ; } } return name ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; Util.ACCOUNT_SVC.myProjectWatch ( new com.google.gerrit.client.rpc.ScreenLoadCallback < java.util.List < com.google.gerrit.common.data.AccountProjectWatchInfo > > ( this ) { public void preDisplay ( final java.util.List < com.google.gerrit.common.data.AccountProjectWatchInfo > result ) { watches.display ( result ) ; } } ) ; }

Target:
protected void populateWatches ( ) { Util.ACCOUNT_SVC.myProjectWatch ( new com.google.gerrit.client.rpc.ScreenLoadCallback < java.util.List < com.google.gerrit.common.data.AccountProjectWatchInfo > > ( this ) { @ java.lang.Override public void preDisplay ( final java.util.List < com.google.gerrit.common.data.AccountProjectWatchInfo > result ) { watches.display ( result ) ; } } ) ; }
Source:
private org.bouncycastle.openpgp.PGPPublicKey getOnlyKeyFromStore ( com.google.gerrit.server.git.gpg.TestKey key ) throws java.lang.Exception { try ( com.google.gerrit.server.git.gpg.PublicKeyStore store = publicKeyStoreProvider.get ( ) ) { java.lang.Iterable < org.bouncycastle.openpgp.PGPPublicKeyRing > keys = store.get ( key.getKeyId ( ) ) ; com.google.common.truth.Truth.assertThat ( keys ) . hasSize ( 1 ) ; return keys.iterator ( ) . next ( ) . getPublicKey ( ) ; } }

Target:
private org.bouncycastle.openpgp.PGPPublicKey getOnlyKeyFromStore ( com.google.gerrit.gpg.testutil.TestKey key ) throws java.lang.Exception { try ( com.google.gerrit.gpg.PublicKeyStore store = publicKeyStoreProvider.get ( ) ) { java.lang.Iterable < org.bouncycastle.openpgp.PGPPublicKeyRing > keys = store.get ( key.getKeyId ( ) ) ; com.google.common.truth.Truth.assertThat ( keys ) . hasSize ( 1 ) ; return keys.iterator ( ) . next ( ) . getPublicKey ( ) ; } }
Source:
public void requestReceived ( com.github.tomakehurst.wiremock.http.Request request , com.github.tomakehurst.wiremock.http.Response response ) { if ( request.getAbsoluteUrl ( ) . contains ( flushRequest ) ) { synchronized ( flushRequest ) { flushRequest.notify ( ) ; } } }

Target:
public void requestReceived ( com.github.tomakehurst.wiremock.http.Request request , com.github.tomakehurst.wiremock.http.Response response ) { if ( request.getAbsoluteUrl ( ) . contains ( flushRequest ) ) { try { checkPoint.await ( ) ; } catch ( java.lang.InterruptedException | java.util.concurrent.BrokenBarrierException e ) { com.google.common.base.Throwables.propagateIfPossible ( e ) ; } } }
Source:
protected void init ( ) { addIcon ( createIcon ( XDocsPlugin.RESOURCES.sideBySideDiffPreview ( ) , "side-by-side preview diff" , com.googlesource.gerrit.plugins.xdocs.client.XDocsPlugin.getSideBySidePreviewDiffUrl ( changeId , base , patchSet , path ) ) ) ; }

Target:
protected void init ( ) { addIcon ( createIcon ( XDocsPlugin.RESOURCES.unifiedDiff ( ) , "unified text diff" , com.googlesource.gerrit.plugins.xdocs.client.XDocsPlugin.getUnifiedDiffUrl ( changeId , base , patchSet , path ) ) ) ; addIcon ( createIcon ( XDocsPlugin.RESOURCES.sideBySideDiffPreview ( ) , "side-by-side preview diff" , com.googlesource.gerrit.plugins.xdocs.client.XDocsPlugin.getSideBySidePreviewDiffUrl ( changeId , base , patchSet , path ) ) ) ; }
Source:
private void render ( com.google.gwtexpui.safehtml.client.SafeHtmlBuilder sb , com.google.gerrit.client.diff.FileInfo info ) { sb.openTr ( ) ; sb.openTd ( ) . setStyleName ( com.google.gerrit.client.change.FileTable.R.css ( ) . pointer ( ) ) . closeTd ( ) ; columnReviewed ( sb , info ) ; columnPath ( sb , info ) ; columnDelta1 ( sb , info ) ; columnDelta2 ( sb , info ) ; sb.closeTr ( ) ; }

Target:
private void render ( com.google.gwtexpui.safehtml.client.SafeHtmlBuilder sb , com.google.gerrit.client.diff.FileInfo info ) { sb.openTr ( ) ; sb.openTd ( ) . setStyleName ( com.google.gerrit.client.change.FileTable.R.css ( ) . pointer ( ) ) . closeTd ( ) ; columnReviewed ( sb , info ) ; columnPath ( sb , info ) ; columnComments ( sb , info ) ; columnDelta1 ( sb , info ) ; columnDelta2 ( sb , info ) ; sb.closeTr ( ) ; }