auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
com.google.common.util.concurrent.ListeningExecutorService getBatchIndexExecutor ( @ com.google.gerrit.server.index.IndexExecutor ( value = com.google.gerrit.server.git.QueueProvider.QueueType.INTERACTIVE ) com.google.common.util.concurrent.ListeningExecutorService interactive , @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config config , com.google.gerrit.server.git.WorkQueue workQueue ) { if ( ( batchExecutor ) != null ) { return batchExecutor ; } int threads = config.getInt ( "index" , null , "batchThreads" , 0 ) ; if ( threads <= 0 ) { return interactive ; } return com.google.common.util.concurrent.MoreExecutors.listeningDecorator ( workQueue.createQueue ( threads , "Index-Batch" ) ) ; }

Target:
com.google.common.util.concurrent.ListeningExecutorService getBatchIndexExecutor ( @ com.google.gerrit.server.index.IndexExecutor ( value = com.google.gerrit.server.git.QueueProvider.QueueType.INTERACTIVE ) com.google.common.util.concurrent.ListeningExecutorService interactive , @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config config , com.google.gerrit.server.git.WorkQueue workQueue ) { if ( ( batchExecutor ) != null ) { return batchExecutor ; } int threads = config.getInt ( "index" , null , "batchThreads" , 0 ) ; if ( threads <= 0 ) { threads = config.getInt ( "changeMerge" , null , "threadPoolSize" , 0 ) ; } if ( threads <= 0 ) { return interactive ; } return com.google.common.util.concurrent.MoreExecutors.listeningDecorator ( workQueue.createQueue ( threads , "Index-Batch" ) ) ; }
Source:
public void run ( ) { try { com.google.gerrit.server.mail.CreateChangeSender cm = createChangeSenderFactory.create ( change ) ; cm.setFrom ( me ) ; cm.setPatchSet ( ps , info ) ; cm.addReviewers ( reviewers ) ; cm.addExtraCC ( cc ) ; cm.send ( ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.git.ReceiveCommits.log.error ( ( "Cannot send email for new change " + ( change.getId ( ) ) ) , e ) ; } }

Target:
public void run ( ) { try { com.google.gerrit.server.mail.CreateChangeSender cm = createChangeSenderFactory.create ( change ) ; cm.setFrom ( me ) ; cm.setPatchSet ( ps , info ) ; cm.addReviewers ( recipients.getReviewers ( ) ) ; cm.addExtraCC ( recipients.getCcOnly ( ) ) ; cm.send ( ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.git.ReceiveCommits.log.error ( ( "Cannot send email for new change " + ( change.getId ( ) ) ) , e ) ; } }
Source:
public boolean canSee ( final com.google.gerrit.reviewdb.client.Account otherUser ) { return canSee ( otherUser.getId ( ) ) ; }

Target:
public boolean canSee ( final com.google.gerrit.server.account.AccountState otherUser ) { return canSee ( new com.google.gerrit.server.account.AccountControl.OtherUser ( ) { @ java.lang.Override Account.Id getId ( ) { return otherUser.getAccount ( ) . getId ( ) ; } @ java.lang.Override com.google.gerrit.server.IdentifiedUser createUser ( ) { return userFactory.create ( otherUser ) ; } } ) ; }
Source:
protected boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.server.CurrentUser user ) { try { permissionBackend.user ( user ) . project ( project ) . check ( ProjectPermission.ACCESS ) ; return true ; } catch ( com.google.gerrit.extensions.restapi.AuthException | com.google.gerrit.server.permissions.PermissionBackendException e ) { return false ; } }

Target:
protected boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.server.CurrentUser user ) { try { com.google.gerrit.server.project.ProjectState state = projectCache.get ( project ) ; if ( ( state == null ) || ( ! ( state.statePermitsRead ( ) ) ) ) { return false ; } permissionBackend.user ( user ) . project ( project ) . check ( ProjectPermission.ACCESS ) ; return true ; } catch ( com.google.gerrit.extensions.restapi.AuthException | com.google.gerrit.server.permissions.PermissionBackendException e ) { return false ; } }
Source:
private java.lang.String parseBranch ( org.eclipse.jgit.revwalk.RevCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.util.List < java.lang.String > branchLines = commit.getFooterLines ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_BRANCH ) ; if ( branchLines.isEmpty ( ) ) { return null ; } else if ( ( branchLines.size ( ) ) > 1 ) { throw expectedOneFooter ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_BRANCH , branchLines ) ; } return com.google.gerrit.reviewdb.client.RefNames.fullName ( branchLines.get ( 0 ) ) ; }

Target:
private java.lang.String parseBranch ( org.eclipse.jgit.revwalk.RevCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.lang.String branch = parseOneFooter ( commit , com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_BRANCH ) ; return branch != null ? com.google.gerrit.reviewdb.client.RefNames.fullName ( branch ) : null ; }
Source:
private void appendFileHeader ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final java.lang.String line ) { openLine ( m ) ; padLineNumber ( m ) ; padLineNumber ( m ) ; m.openTd ( ) ; m.addStyleName ( "DiffText" ) ; m.addStyleName ( "DiffText-FILE_HEADER" ) ; m.append ( line ) ; m.closeTd ( ) ; closeLine ( m ) ; }

Target:
private void appendFileHeader ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final java.lang.String line ) { openLine ( m ) ; padLineNumber ( m ) ; padLineNumber ( m ) ; m.openTd ( ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffText ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffTextFileHeader ( ) ) ; m.append ( line ) ; m.closeTd ( ) ; closeLine ( m ) ; }
Source:
public void testMissingDownstreamMerges ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result result = createChange ( "subject" , "filename" , "content" , "testtopic" ) ; pushConfig ( "automerger.config" , result.getChange ( ) . project ( ) . get ( ) ) ; result.assertOkStatus ( ) ; int changeNumber = result.getChange ( ) . getId ( ) . id ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceConflictException.class ) ; exception.expectMessage ( ( ( "Failed to submit 1 change due to the following problems:\nChange " + changeNumber ) + ": Missing downstream branches ds_one. Please recreate the automerges." ) ) ; merge ( result ) ; }

Target:
public void testNoMissingDownstreamMerges_branchWithQuotes ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result result = createChange ( "subject" , "filename" , "content" , "testtopic" ) ; java.lang.String projectName = result.getChange ( ) . change ( ) . getProject ( ) . get ( ) ; createBranch ( new com.google.gerrit.reviewdb.client.Branch.NameKey ( projectName , "branch\"quotes" ) ) ; pushConfig ( "automerger.config" , projectName , "branch\"quotes" ) ; amendChange ( result.getChangeId ( ) ) ; result.assertOkStatus ( ) ; merge ( result ) ; }
Source:
private boolean longRunning ( ) { return ( ( java.lang.System.currentTimeMillis ( ) ) - ( start ) ) > 200 ; }

Target:
private boolean longRunning ( int i ) { if ( ( ( i % 10 ) == 0 ) && ( ( ( java.lang.System.currentTimeMillis ( ) ) - ( start ) ) > 100 ) ) { progress.setValue ( ( ( 100 * ( row ) ) / ( list.length ( ) ) ) ) ; return true ; } return false ; }
Source:
public void run ( ) { boolean s = prefs.showWhitespaceErrors ( ) ; view.getCmFromSide ( DisplaySide.A ) . setOption ( "showTrailingSpace" , s ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "showTrailingSpace" , s ) ; }

Target:
void onTopMenu ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.hideTopMenu ( ( ! ( e.getValue ( ) ) ) ) ; if ( ( view ) != null ) { com.google.gerrit.client.Gerrit.setHeaderVisible ( ( ! ( prefs.hideTopMenu ( ) ) ) ) ; view.resizeCodeMirror ( ) ; } }
Source:
private static com.google.gerrit.reviewdb.client.Project.InheritedBoolean getBool ( com.google.gwt.user.client.ui.ListBox box ) { int i = box.getSelectedIndex ( ) ; if ( i >= 0 ) { return com.google.gerrit.reviewdb.client.Project.InheritedBoolean.valueOf ( box.getValue ( i ) ) ; } return com.google.gerrit.reviewdb.client.Project.InheritedBoolean.INHERIT ; }

Target:
private static com.google.gerrit.reviewdb.client.Project.InheritableBoolean getBool ( com.google.gwt.user.client.ui.ListBox box ) { int i = box.getSelectedIndex ( ) ; if ( i >= 0 ) { final java.lang.String selectedValue = box.getValue ( i ) ; if ( selectedValue.startsWith ( InheritableBoolean.INHERIT.name ( ) ) ) { return com.google.gerrit.reviewdb.client.Project.InheritableBoolean.INHERIT ; } return com.google.gerrit.reviewdb.client.Project.InheritableBoolean.valueOf ( selectedValue ) ; } return com.google.gerrit.reviewdb.client.Project.InheritableBoolean.INHERIT ; }
Source:
private static boolean isContentType ( com.google.gwt.http.client.Response res , java.lang.String want ) { java.lang.String type = res.getHeader ( "Content-Type" ) ; if ( type == null ) { return false ; } int semi = type.indexOf ( ';' ) ; if ( semi >= 0 ) { type = type.substring ( 0 , semi ) . trim ( ) ; } return want.equals ( type ) ; }

Target:
private static boolean isContentType ( com.google.gwt.http.client.Response res , java.lang.String want ) { java.lang.String type = res.getHeader ( "Content-Type" ) ; return ( type != null ) && ( want.equals ( com.google.gerrit.client.rpc.RestApi.simpleType ( type ) ) ) ; }
Source:
private com.google.gerrit.server.query.Predicate < T > defaultField ( org.antlr.runtime.tree.Tree r ) throws com.google.gerrit.index.query.QueryParseException { switch ( r.getType ( ) ) { case com.google.gerrit.index.query.QueryParser.SINGLE_WORD : case com.google.gerrit.index.query.QueryParser.EXACT_PHRASE : if ( ( r.getChildCount ( ) ) != 0 ) { throw com.google.gerrit.server.query.QueryBuilder.error ( ( "Expected no children under: " + r ) ) ; } return defaultField ( r.getText ( ) ) ; default : throw com.google.gerrit.server.query.QueryBuilder.error ( ( "Unsupported node: " + r ) ) ; } }

Target:
private com.google.gerrit.index.query.Predicate < T > defaultField ( org.antlr.runtime.tree.Tree r ) throws com.google.gerrit.index.query.QueryParseException { switch ( r.getType ( ) ) { case com.google.gerrit.index.query.QueryParser.SINGLE_WORD : case com.google.gerrit.index.query.QueryParser.EXACT_PHRASE : if ( ( r.getChildCount ( ) ) != 0 ) { throw com.google.gerrit.index.query.QueryBuilder.error ( ( "Expected no children under: " + r ) ) ; } return defaultField ( r.getText ( ) ) ; default : throw com.google.gerrit.index.query.QueryBuilder.error ( ( "Unsupported node: " + r ) ) ; } }
Source:
public void testUnblockInLocalVisibilityByRegisteredUsers_Fails ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; org.junit.Assert.assertFalse ( "u can't read" , u.controlForRef ( "refs/heads/master" ) . isVisibleByRegisteredUsers ( ) ) ; }

Target:
public void testUnblockInLocalVisibilityByRegisteredUsers_Fails ( ) { com.google.gerrit.server.project.Util.block ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; org.junit.Assert.assertFalse ( "u can't read" , u.controlForRef ( "refs/heads/master" ) . isVisibleByRegisteredUsers ( ) ) ; }
Source:
public static void replyError ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , int statusCode , java.lang.String msg , com.google.gerrit.extensions.restapi.CacheControl c ) throws java.io.IOException { res.setStatus ( statusCode ) ; com.google.gerrit.httpd.restapi.RestApiServlet.configureCaching ( req , res , null , c ) ; com.google.gerrit.httpd.restapi.RestApiServlet.replyText ( req , res , msg ) ; }

Target:
public static void replyError ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , int statusCode , java.lang.String msg , com.google.gerrit.extensions.restapi.CacheControl c , @ com.google.gerrit.common.Nullable java.lang.Throwable err ) throws java.io.IOException { res.setStatus ( statusCode ) ; com.google.gerrit.httpd.restapi.RestApiServlet.configureCaching ( req , res , null , c ) ; com.google.gerrit.httpd.restapi.RestApiServlet.replyText ( req , res , msg ) ; if ( err != null ) { com.google.gerrit.httpd.RequestUtil.setErrorTraceAttribute ( req , err ) ; } }
Source:
public void destroy ( ) { synchronized ( this ) { if ( ( cmd ) != null ) { final com.google.gerrit.sshd.SshScope.Context old = com.google.gerrit.sshd.SshScope.set ( ctx ) ; try { cmd.destroy ( ) ; log ( BaseCommand.STATUS_CANCEL ) ; } finally { ctx = null ; cmd = null ; com.google.gerrit.sshd.SshScope.set ( old ) ; } } } }

Target:
private void onDestroy ( ) { synchronized ( this ) { if ( ( cmd ) != null ) { final com.google.gerrit.sshd.SshScope.Context old = com.google.gerrit.sshd.SshScope.set ( ctx ) ; try { cmd.destroy ( ) ; log ( BaseCommand.STATUS_CANCEL ) ; } finally { ctx = null ; cmd = null ; com.google.gerrit.sshd.SshScope.set ( old ) ; } } } }
Source:
public java.util.List < com.google.gerrit.server.project.ProjectJson.ProjectInfo > apply ( com.google.gerrit.server.project.ProjectResource rsrc ) { java.util.List < com.google.gerrit.server.project.ProjectJson.ProjectInfo > childProjects = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey projectName : projectCache.all ( ) ) { com.google.gerrit.server.project.ProjectState e = projectCache.get ( projectName ) ; if ( e == null ) { continue ; } if ( rsrc.getNameKey ( ) . equals ( e.getProject ( ) . getParent ( allProjects ) ) ) { childProjects.add ( json.format ( e.getProject ( ) ) ) ; } } return childProjects ; }

Target:
private java.util.List < com.google.gerrit.server.project.ProjectJson.ProjectInfo > getDirectChildProjects ( com.google.gerrit.reviewdb.client.Project.NameKey parent ) { java.util.List < com.google.gerrit.server.project.ProjectJson.ProjectInfo > childProjects = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey projectName : projectCache.all ( ) ) { com.google.gerrit.server.project.ProjectState e = projectCache.get ( projectName ) ; if ( e == null ) { continue ; } if ( parent.equals ( e.getProject ( ) . getParent ( allProjects ) ) ) { childProjects.add ( json.format ( e.getProject ( ) ) ) ; } } return childProjects ; }
Source:
private void assertCreateFails ( java.lang.Class < ? extends com.google.gerrit.extensions.restapi.RestApiException > errType , java.lang.String errMsg ) throws java.lang.Exception { exception.expect ( errType ) ; if ( errMsg != null ) { exception.expectMessage ( errMsg ) ; } branch ( ) . create ( new com.google.gerrit.extensions.api.projects.BranchInput ( ) ) ; }

Target:
private void assertCreateFails ( com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.lang.String revision , java.lang.Class < ? extends com.google.gerrit.extensions.restapi.RestApiException > errType , java.lang.String errMsg ) throws java.lang.Exception { exception.expect ( errType ) ; if ( errMsg != null ) { exception.expectMessage ( errMsg ) ; } com.google.gerrit.extensions.api.projects.BranchInput in = new com.google.gerrit.extensions.api.projects.BranchInput ( ) ; in.revision = revision ; branch ( branch ) . create ( in ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( com.google.gerrit.testutil.NoteDbMode.get ( ) ) . isEqualTo ( NoteDbMode.OFF ) ; gerritConfig = new org.eclipse.jgit.storage.file.FileBasedConfig ( sitePaths.gerrit_config.toFile ( ) , org.eclipse.jgit.util.FS.detect ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( com.google.gerrit.testutil.NoteDbMode.get ( ) ) . isEqualTo ( NoteDbMode.OFF ) ; gerritConfig = new org.eclipse.jgit.storage.file.FileBasedConfig ( sitePaths.gerrit_config.toFile ( ) , org.eclipse.jgit.util.FS.detect ( ) ) ; noteDbConfig = new org.eclipse.jgit.storage.file.FileBasedConfig ( sitePaths.notedb_config.toFile ( ) , org.eclipse.jgit.util.FS.detect ( ) ) ; }
Source:
public void withNonDuplicateGroupName ( ) throws java.lang.Exception { java.lang.String newGroupName = "newGroupB" ; sshSession.exec ( ( "gerrit create-group " + newGroupName ) ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( sshSession.getError ( ) ) . that ( sshSession.hasError ( ) ) . isFalse ( ) ; com.google.gerrit.reviewdb.client.AccountGroup accountGroup = groupCache.get ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( newGroupName ) ) ; com.google.common.truth.Truth.assertThat ( accountGroup ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( accountGroup.getName ( ) ) . isEqualTo ( newGroupName ) ; }

Target:
public void withNonDuplicateGroupName ( ) throws java.lang.Exception { java.lang.String newGroupName = "newGroupB" ; adminSshSession.exec ( ( "gerrit create-group " + newGroupName ) ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( adminSshSession.getError ( ) ) . that ( adminSshSession.hasError ( ) ) . isFalse ( ) ; com.google.gerrit.reviewdb.client.AccountGroup accountGroup = groupCache.get ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( newGroupName ) ) ; com.google.common.truth.Truth.assertThat ( accountGroup ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( accountGroup.getName ( ) ) . isEqualTo ( newGroupName ) ; }
Source:
static void initLibrary ( com.google.gwt.user.client.rpc.AsyncCallback < java.lang.Void > cb ) { if ( net.codemirror.lib.Loader.isLibLoaded ( ) ) { cb.onSuccess ( null ) ; } else { net.codemirror.lib.Loader.injectCss ( Lib.I.css ( ) ) ; net.codemirror.lib.Loader.injectScript ( Lib.I.js ( ) . getSafeUri ( ) , cb ) ; } }

Target:
public void onFailure ( java.lang.Throwable caught ) { }
Source:
protected boolean onKeyPress ( final char keyCode , final int modifiers ) { if ( super . onKeyPress ( keyCode , modifiers ) ) { return true ; } if ( modifiers == 0 ) { switch ( keyCode ) { case 's' : case 'c' : toggleCurrentRow ( ) ; return true ; } } return false ; }

Target:
public void onTabSelected ( com.google.gwt.user.client.ui.SourcesTabEvents sender , int tabIndex ) { com.google.gerrit.client.Gerrit.display ( tabTokens.get ( tabIndex ) , false ) ; }
Source:
public void onBrowserEvent ( com.google.gwt.user.client.Event event ) { super . onBrowserEvent ( event ) ; if ( ( ( com.google.gwt.user.client.DOM.eventGetType ( event ) ) == ( com.google.gwt.user.client.Event.ONCLICK ) ) && ( com.google.gerrit.client.ui.LinkMenuItem.impl.handleAsClick ( event ) ) ) { com.google.gerrit.client.ui.LinkMenuItem.implPanel.blur ( getElement ( ) ) ; } }

Target:
public void onBrowserEvent ( com.google.gwt.user.client.Event event ) { super . onBrowserEvent ( event ) ; if ( ( ( com.google.gwt.user.client.DOM.eventGetType ( event ) ) == ( com.google.gwt.user.client.Event.ONCLICK ) ) && ( com.google.gerrit.client.ui.LinkMenuItem.impl.handleAsClick ( event ) ) ) { com.google.gwt.dom.client.AnchorElement.as ( getElement ( ) ) . blur ( ) ; } }
Source:
public void add ( com.google.gerrit.lifecycle.LifecycleListener listener ) { manager.add ( listener ) ; }

Target:
public java.io.File get ( ) { if ( ! ( ready ) ) { synchronized ( dataDir ) { if ( ( ! ( dataDir.exists ( ) ) ) && ( ! ( dataDir.mkdirs ( ) ) ) ) { throw new com.google.inject.ProvisionException ( java.lang.String.format ( "Cannot create %s for plugin %s" , dataDir.getAbsolutePath ( ) , name ) ) ; } ready = true ; } } return dataDir ; }
Source:
private Account.Id parseIdent ( org.eclipse.jgit.revwalk.RevCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.lang.String email = commit.getCommitterIdent ( ) . getEmailAddress ( ) ; int at = email.indexOf ( '@' ) ; if ( at >= 0 ) { java.lang.String host = email.substring ( ( at + 1 ) , email.length ( ) ) ; java.lang.Integer id = com.google.common.primitives.Ints.tryParse ( email.substring ( 0 , at ) ) ; if ( ( id != null ) && ( host.equals ( com.google.gerrit.server.notedb.ChangeNoteUtil.GERRIT_PLACEHOLDER_HOST ) ) ) { return new com.google.gerrit.reviewdb.client.Account.Id ( id ) ; } } throw parseException ( "invalid committer, expected <id>@%s: %s" , com.google.gerrit.server.notedb.ChangeNoteUtil.GERRIT_PLACEHOLDER_HOST , email ) ; }

Target:
public com.google.common.collect.ImmutableSetMultimap < com.google.gerrit.server.notedb.ReviewerState , com.google.gerrit.reviewdb.client.Account.Id > getReviewers ( ) { return reviewers ; }
Source:
public Account.Id apply ( com.google.gerrit.reviewdb.client.StarredChange in ) { return in.getAccountId ( ) ; }

Target:
public java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > byChange ( com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { return com.google.common.collect.FluentIterable.from ( getRefNames ( com.google.gerrit.reviewdb.client.RefNames.refsStarredChangesPrefix ( changeId ) ) ) . transform ( new com.google.common.base.Function < java.lang.String , com.google.gerrit.reviewdb.client.Account.Id > ( ) { @ java.lang.Override public Account.Id apply ( java.lang.String refPart ) { return Account.Id.parse ( refPart ) ; } } ) . toSet ( ) ; }
Source:
public int weigh ( com.google.gitiles.blame.BlameCacheImpl.Key key , java.util.List < com.google.gitiles.blame.Region > value ) { return value.size ( ) ; }

Target:
public static com.google.common.cache.CacheBuilder < com.google.gitiles.blame.BlameCacheImpl.Key , java.util.List < com.google.gitiles.blame.Region > > weigher ( com.google.common.cache.CacheBuilder < ? super com.google.gitiles.blame.BlameCacheImpl.Key , ? super java.util.List < com.google.gitiles.blame.Region > > builder ) { return builder.weigher ( ( k , v ) -> v.size ( ) ) ; }
Source:
private void loadBase ( java.lang.String notesBranch ) throws java.io.IOException { org.eclipse.jgit.lib.Ref branch = db.getRef ( notesBranch ) ; if ( branch != null ) { baseCommit = revWalk.parseCommit ( branch.getObjectId ( ) ) ; base = org.eclipse.jgit.notes.NoteMap.read ( revWalk.getObjectReader ( ) , baseCommit ) ; } if ( ( baseCommit ) != null ) { ours = org.eclipse.jgit.notes.NoteMap.read ( revWalk.getObjectReader ( ) , baseCommit ) ; } else { ours = org.eclipse.jgit.notes.NoteMap.newEmptyMap ( ) ; } }

Target:
private void loadBase ( java.lang.String notesBranch ) throws java.io.IOException { org.eclipse.jgit.lib.Ref branch = db.getRefDatabase ( ) . exactRef ( notesBranch ) ; if ( branch != null ) { baseCommit = revWalk.parseCommit ( branch.getObjectId ( ) ) ; base = org.eclipse.jgit.notes.NoteMap.read ( revWalk.getObjectReader ( ) , baseCommit ) ; } if ( ( baseCommit ) != null ) { ours = org.eclipse.jgit.notes.NoteMap.read ( revWalk.getObjectReader ( ) , baseCommit ) ; } else { ours = org.eclipse.jgit.notes.NoteMap.newEmptyMap ( ) ; } }
Source:
public static java.lang.String format ( final com.google.gerrit.reviewdb.client.Change change ) { return ( ( ( ( change.getProject ( ) . get ( ) ) + "~" ) + ( change.getDest ( ) . getShortName ( ) ) ) + "~" ) + ( change.getKey ( ) . get ( ) ) ; }

Target:
public static java.lang.String format ( com.google.gerrit.reviewdb.client.Change change ) { return com.google.gerrit.server.change.ChangeTriplet.format ( change.getDest ( ) , change.getKey ( ) ) ; }
Source:
protected void throwUnauthorizedOp ( java.lang.String op , com.google.gerrit.server.project.ProjectControl control ) throws org.eclipse.jgit.lfs.errors.LfsUnauthorized { java.lang.String project = control.getProject ( ) . getName ( ) ; java.lang.String userName = ( com.google.common.base.Strings.isNullOrEmpty ( control.getUser ( ) . getUserName ( ) ) ) ? "anonymous" : control.getUser ( ) . getUserName ( ) ; com.googlesource.gerrit.plugins.lfs.locks.LfsLocksAction.log.debug ( java.lang.String.format ( "operation %s unauthorized for user %s on project %s" , op , userName , project ) ) ; throw new org.eclipse.jgit.lfs.errors.LfsUnauthorized ( op , project ) ; }

Target:
protected void throwUnauthorizedOp ( java.lang.String op , com.google.gerrit.server.project.ProjectState state , com.google.gerrit.server.CurrentUser user ) throws org.eclipse.jgit.lfs.errors.LfsUnauthorized { java.lang.String project = state.getProject ( ) . getName ( ) ; java.lang.String userName = ( com.google.common.base.Strings.isNullOrEmpty ( user.getUserName ( ) ) ) ? "anonymous" : user.getUserName ( ) ; com.googlesource.gerrit.plugins.lfs.locks.LfsLocksAction.log.debug ( java.lang.String.format ( "operation %s unauthorized for user %s on project %s" , op , userName , project ) ) ; throw new org.eclipse.jgit.lfs.errors.LfsUnauthorized ( op , project ) ; }
Source:
private com.google.gerrit.server.project.ProjectState getProjectState ( ) { return projectControl.getProjectState ( ) ; }

Target:
private boolean matchGroup ( com.google.gerrit.reviewdb.AccountGroup.UUID uuid ) { java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > userGroups = getCurrentUser ( ) . getEffectiveGroups ( ) ; if ( AccountGroup.PROJECT_OWNERS.equals ( uuid ) ) { com.google.gerrit.server.project.ProjectState state = projectControl.getProjectState ( ) ; return com.google.gerrit.common.CollectionsUtil.isAnyIncludedIn ( state.getAllOwners ( ) , userGroups ) ; } else { return userGroups.contains ( uuid ) ; } }
Source:
private com.google.gerrit.extensions.client.SubmitType getSubmitType ( com.google.gerrit.server.query.change.ChangeData cd , com.google.gerrit.reviewdb.client.PatchSet patchSet ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.common.data.SubmitTypeRecord rec = new com.google.gerrit.server.project.SubmitRuleEvaluator ( cd ) . setPatchSet ( patchSet ) . getSubmitType ( ) ; if ( ( rec.status ) != ( SubmitTypeRecord.Status.OK ) ) { throw new com.google.gwtorm.server.OrmException ( ( "Submit type rule failed: " + rec ) ) ; } return rec.type ; }

Target:
private com.google.gerrit.extensions.client.SubmitType getSubmitType ( com.google.gerrit.server.query.change.ChangeData cd , com.google.gerrit.reviewdb.client.PatchSet patchSet ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.common.data.SubmitTypeRecord rec = new com.google.gerrit.server.project.SubmitRuleEvaluator ( accountCache , cd ) . setPatchSet ( patchSet ) . getSubmitType ( ) ; if ( ( rec.status ) != ( SubmitTypeRecord.Status.OK ) ) { throw new com.google.gwtorm.server.OrmException ( ( "Submit type rule failed: " + rec ) ) ; } return rec.type ; }
Source:
private static GitilesView.Builder copyAndCanonicalize ( com.google.gitiles.GitilesView view , java.lang.String revision ) { com.google.gitiles.GitilesView.Builder copy = com.google.gitiles.GitilesView.log ( ) . copyFrom ( view ) ; if ( ( view.getRevision ( ) ) != ( Revision.NULL ) ) { copy.setRevision ( view.getRevision ( ) ) ; } else { copy.setRevision ( com.google.gitiles.Revision.named ( revision ) ) ; } if ( ( view.getOldRevision ( ) ) != ( Revision.NULL ) ) { copy.setOldRevision ( view.getOldRevision ( ) ) ; } return copy ; }

Target:
private GitilesView.Builder copyAndCanonicalizeView ( java.lang.String revision ) { com.google.gitiles.GitilesView.Builder copy = com.google.gitiles.GitilesView.log ( ) . copyFrom ( view ) ; if ( ( view.getRevision ( ) ) != ( Revision.NULL ) ) { copy.setRevision ( view.getRevision ( ) ) ; } else { copy.setRevision ( com.google.gitiles.Revision.named ( revision ) ) ; } if ( ( view.getOldRevision ( ) ) != ( Revision.NULL ) ) { copy.setOldRevision ( view.getOldRevision ( ) ) ; } return copy ; }
Source:
public void testFindNoDuplicates ( ) throws java.lang.Exception { changedPaths = com.google.common.collect.Sets.newHashSet ( "a" , "ab" , "f1/ab" ) ; runCheck ( com.googlesource.gerrit.plugins.uploadvalidator.DuplicatePathnameValidatorTest.INITIAL_PATHNAMES , changedPaths , messages , vistedPaths ) ; com.google.common.truth.Truth.assertThat ( messages ) . isEmpty ( ) ; com.google.common.truth.Truth.assertThat ( vistedPaths ) . containsExactlyElementsIn ( com.google.common.collect.ImmutableList.of ( "a" , "ab" , "f1" , "f1/a" , "f1/ab" , "f2" ) ) ; }

Target:
public void testFindNoDuplicates ( ) throws java.lang.Exception { changedPaths = com.google.common.collect.Sets.newHashSet ( "a" , "ab" , "f1/ab" ) ; runCheck ( com.googlesource.gerrit.plugins.uploadvalidator.DuplicatePathnameValidatorTest.INITIAL_PATHNAMES , changedPaths , messages , vistedPaths ) ; com.google.common.truth.Truth.assertThat ( messages ) . isEmpty ( ) ; com.google.common.truth.Truth.assertThat ( vistedPaths ) . containsExactly ( "a" , "ab" , "f1" , "f1/a" , "f1/ab" , "f2" ) ; }
Source:
java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > toFileInfoMap ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.RevId revision , @ com.google.gerrit.common.Nullable com.google.gerrit.reviewdb.client.PatchSet base ) throws com.google.gerrit.server.patch.PatchListNotAvailableException { org.eclipse.jgit.lib.ObjectId a = ( base == null ) ? null : org.eclipse.jgit.lib.ObjectId.fromString ( base.getRevision ( ) . get ( ) ) ; org.eclipse.jgit.lib.ObjectId b = org.eclipse.jgit.lib.ObjectId.fromString ( revision.get ( ) ) ; return toFileInfoMap ( change , new com.google.gerrit.server.patch.PatchListKey ( a , b , com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace.IGNORE_NONE ) ) ; }

Target:
java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > toFileInfoMap ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.RevId revision , @ com.google.gerrit.common.Nullable com.google.gerrit.reviewdb.client.PatchSet base ) throws com.google.gerrit.server.patch.PatchListNotAvailableException { org.eclipse.jgit.lib.ObjectId objectId = org.eclipse.jgit.lib.ObjectId.fromString ( revision.get ( ) ) ; return toFileInfoMap ( change , objectId , base ) ; }
Source:
public void onAgreementSignup ( com.google.gerrit.extensions.events.AgreementSignupListener.Event event ) { com.google.gerrit.extensions.common.AccountInfo submitter = event.getAccount ( ) ; if ( submitter != null ) { com.googlesource.gerrit.plugins.hooks.HookArgs args = hookFactory.createArgs ( ) ; args.add ( "--submitter" , submitter ) ; args.add ( "--user-id" , submitter._accountId ) ; args.add ( "--cla-name" , event.getAgreementName ( ) ) ; hook.submit ( args ) ; } }

Target:
public void onAgreementSignup ( com.google.gerrit.extensions.events.AgreementSignupListener.Event event ) { com.google.gerrit.extensions.common.AccountInfo submitter = event.getAccount ( ) ; if ( submitter != null ) { com.googlesource.gerrit.plugins.hooks.HookArgs args = hookFactory.createArgs ( ) ; args.add ( "--submitter" , submitter ) ; args.add ( "--user-id" , submitter._accountId ) ; args.add ( "--cla-name" , event.getAgreementName ( ) ) ; hook.execute ( args ) ; } }
Source:
protected void movePointerTo ( final int newRow ) { super . movePointerTo ( newRow ) ; if ( ( ( 0 <= newRow ) && ( newRow < ( table.getRowCount ( ) ) ) ) && ( ( getRowItem ( newRow ) ) != null ) ) { delSel.setEnabled ( true ) ; } else { delSel.setEnabled ( false ) ; } }

Target:
protected void onOpenItem ( final com.google.gerrit.client.reviewdb.AccountSshKey item ) { toggleCurrentRow ( ) ; }
Source:
public void removeNonexisting ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key1 = com.google.gerrit.gpg.testutil.TestKeys.key1 ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , store.save ( newCommitBuilder ( ) ) ) ; com.google.gerrit.gpg.testutil.TestKey key2 = com.google.gerrit.gpg.testutil.TestKeys.key2 ( ) ; store.remove ( key2.getPublicKey ( ) . getFingerprint ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NO_CHANGE , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) , key1 ) ; }

Target:
public void removeNonexisting ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key1 = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithoutExpiration ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , store.save ( newCommitBuilder ( ) ) ) ; com.google.gerrit.gpg.testutil.TestKey key2 = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithExpiration ( ) ; store.remove ( key2.getPublicKey ( ) . getFingerprint ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NO_CHANGE , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) , key1 ) ; }
Source:
public void setup ( ) throws java.lang.Exception { normalProject = createProject ( "normal" ) ; secretProject = createProject ( "secret" ) ; secretRefProject = createProject ( "secretRef" ) ; privilegedGroup = groupCache.get ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( createGroup ( "privilegedGroup" ) ) ) ; privilegedUser = accounts.create ( "privilegedUser" , "snowden@nsa.gov" , "Ed Snowden" ) ; gApi.groups ( ) . id ( privilegedGroup.getGroupUUID ( ) . get ( ) ) . addMembers ( privilegedUser.username ) ; com.google.common.truth.Truth.assertThat ( gApi.groups ( ) . id ( privilegedGroup.getGroupUUID ( ) . get ( ) ) . members ( ) . get ( 0 ) . email ) . contains ( "snowden" ) ; grant ( Permission.READ , secretProject , "refs/*" , false , privilegedGroup.getGroupUUID ( ) ) ; block ( Permission.READ , SystemGroupBackend.REGISTERED_USERS , "refs/*" , secretProject ) ; deny ( secretRefProject , Permission.READ , SystemGroupBackend.ANONYMOUS_USERS , "refs/*" ) ; grant ( Permission.READ , secretRefProject , "refs/heads/secret/*" , false , privilegedGroup.getGroupUUID ( ) ) ; block ( Permission.READ , SystemGroupBackend.REGISTERED_USERS , "refs/heads/secret/*" , secretRefProject ) ; grant ( Permission.READ , secretRefProject , "refs/heads/*" , false , SystemGroupBackend.REGISTERED_USERS ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { normalProject = createProject ( "normal" ) ; secretProject = createProject ( "secret" ) ; secretRefProject = createProject ( "secretRef" ) ; privilegedGroup = groupCache.get ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( createGroup ( "privilegedGroup" ) ) ) ; privilegedUser = accounts.create ( "privilegedUser" , "snowden@nsa.gov" , "Ed Snowden" ) ; gApi.groups ( ) . id ( privilegedGroup.getGroupUUID ( ) . get ( ) ) . addMembers ( privilegedUser.username ) ; com.google.common.truth.Truth.assertThat ( gApi.groups ( ) . id ( privilegedGroup.getGroupUUID ( ) . get ( ) ) . members ( ) . get ( 0 ) . email ) . contains ( "snowden" ) ; grant ( Permission.READ , secretProject , "refs/*" , false , privilegedGroup.getGroupUUID ( ) ) ; block ( Permission.READ , SystemGroupBackend.REGISTERED_USERS , "refs/*" , secretProject ) ; deny ( secretRefProject , Permission.READ , SystemGroupBackend.ANONYMOUS_USERS , "refs/*" ) ; grant ( Permission.READ , secretRefProject , "refs/heads/secret/*" , false , privilegedGroup.getGroupUUID ( ) ) ; block ( Permission.READ , SystemGroupBackend.REGISTERED_USERS , "refs/heads/secret/*" , secretRefProject ) ; grant ( Permission.READ , secretRefProject , "refs/heads/*" , false , SystemGroupBackend.REGISTERED_USERS ) ; }
Source:
public void visit ( org.commonmark.node.Image node ) { html.open ( "img" ) . attribute ( "src" , resolveImageUrl ( node.getDestination ( ) ) ) . attribute ( "title" , node.getTitle ( ) ) . attribute ( "alt" , com.google.gitiles.doc.MarkdownUtil.getInnerText ( node ) ) ; }

Target:
public void visit ( org.commonmark.node.Image node ) { html.open ( "img" ) . attribute ( "src" , image ( node.getDestination ( ) ) ) . attribute ( "title" , node.getTitle ( ) ) . attribute ( "alt" , com.google.gitiles.doc.MarkdownUtil.getInnerText ( node ) ) ; }
Source:
public int compareTo ( com.google.gerrit.common.data.PermissionRule o ) { int cmp = ( com.google.gerrit.common.data.PermissionRule.deny ( this ) ) - ( com.google.gerrit.common.data.PermissionRule.deny ( o ) ) ; if ( cmp == 0 ) cmp = ( com.google.gerrit.common.data.PermissionRule.range ( o ) ) - ( com.google.gerrit.common.data.PermissionRule.range ( this ) ) ; if ( cmp == 0 ) cmp = com.google.gerrit.common.data.PermissionRule.group ( this ) . compareTo ( com.google.gerrit.common.data.PermissionRule.group ( o ) ) ; return cmp ; }

Target:
public int compareTo ( com.google.gerrit.common.data.PermissionRule o ) { int cmp = ( com.google.gerrit.common.data.PermissionRule.action ( this ) ) - ( com.google.gerrit.common.data.PermissionRule.action ( o ) ) ; if ( cmp == 0 ) cmp = ( com.google.gerrit.common.data.PermissionRule.range ( o ) ) - ( com.google.gerrit.common.data.PermissionRule.range ( this ) ) ; if ( cmp == 0 ) cmp = com.google.gerrit.common.data.PermissionRule.group ( this ) . compareTo ( com.google.gerrit.common.data.PermissionRule.group ( o ) ) ; return cmp ; }
Source:
public static java.util.Map < java.lang.String , java.lang.String > toSoyData ( org.eclipse.jgit.lib.PersonIdent ident , com.google.gitiles.DateFormatterBuilder.DateFormatter df ) { return com.google.common.collect.ImmutableMap.of ( "name" , ident.getName ( ) , "email" , ident.getEmailAddress ( ) , "time" , df.format ( ident ) , "relativeTime" , org.eclipse.jgit.util.RelativeDateFormatter.format ( ident.getWhen ( ) ) ) ; }

Target:
public static java.util.Map < java.lang.String , java.lang.String > toSoyData ( org.eclipse.jgit.lib.PersonIdent ident , com.google.gitiles.DateFormatter df ) { return com.google.common.collect.ImmutableMap.of ( "name" , ident.getName ( ) , "email" , ident.getEmailAddress ( ) , "time" , df.format ( ident ) , "relativeTime" , org.eclipse.jgit.util.RelativeDateFormatter.format ( ident.getWhen ( ) ) ) ; }
Source:
public void testUpdateOneException ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchException ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , new java.sql.BatchUpdateException ( ) ) ; try { createClassUnderTest ( ) . update ( com.google.gwtorm.jdbc.TestJdbcAccess.ONE_ROW ) ; org.junit.Assert.fail ( "missingException" ) ; } catch ( com.google.gwtorm.client.OrmException e ) { } }

Target:
public void testUpsertTwoFirstExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 1 , 0 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , 1 ) ; createClassUnderTest ( ) . upsert ( twoRows ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( insert ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertExpectedIdsUsed ( insert , 2 ) ; }
Source:
protected void configure ( ) { bind ( org.apache.http.impl.client.CloseableHttpClient.class ) . toProvider ( com.ericsson.gerrit.plugins.multimaster.HttpClientProvider.class ) . in ( Scopes.SINGLETON ) ; bind ( com.ericsson.gerrit.plugins.multimaster.Configuration.class ) . in ( Scopes.SINGLETON ) ; bind ( com.ericsson.gerrit.plugins.multimaster.HttpSession.class ) ; bind ( com.ericsson.gerrit.plugins.multimaster.RestSession.class ) ; bind ( java.util.concurrent.Executor.class ) . annotatedWith ( com.ericsson.gerrit.plugins.multimaster.SyncIndexExecutor.class ) . toProvider ( com.ericsson.gerrit.plugins.multimaster.SyncIndexExecutorProvider.class ) ; listener ( ) . to ( com.ericsson.gerrit.plugins.multimaster.SyncIndexExecutorProvider.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.ChangeIndexedListener.class ) . to ( com.ericsson.gerrit.plugins.multimaster.IndexEventHandler.class ) ; }

Target:
protected void configure ( ) { bind ( org.apache.http.impl.client.CloseableHttpClient.class ) . toProvider ( com.ericsson.gerrit.plugins.multimaster.HttpClientProvider.class ) . in ( Scopes.SINGLETON ) ; bind ( com.ericsson.gerrit.plugins.multimaster.Configuration.class ) . in ( Scopes.SINGLETON ) ; bind ( com.ericsson.gerrit.plugins.multimaster.HttpSession.class ) ; bind ( com.ericsson.gerrit.plugins.multimaster.EventForwarder.class ) . to ( com.ericsson.gerrit.plugins.multimaster.RestEventForwarder.class ) ; bind ( java.util.concurrent.Executor.class ) . annotatedWith ( com.ericsson.gerrit.plugins.multimaster.SyncIndexExecutor.class ) . toProvider ( com.ericsson.gerrit.plugins.multimaster.SyncIndexExecutorProvider.class ) ; listener ( ) . to ( com.ericsson.gerrit.plugins.multimaster.SyncIndexExecutorProvider.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.ChangeIndexedListener.class ) . to ( com.ericsson.gerrit.plugins.multimaster.IndexEventHandler.class ) ; }
Source:
public static void deleteBranches ( com.google.gerrit.reviewdb.client.Project.NameKey projectName , java.util.Set < java.lang.String > refs , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > cb ) { com.google.gerrit.client.rpc.CallbackGroup group = new com.google.gerrit.client.rpc.CallbackGroup ( ) ; for ( java.lang.String ref : refs ) { new com.google.gerrit.client.rpc.RestApi ( "/projects/" ) . id ( projectName.get ( ) ) . view ( "branches" ) . id ( ref ) . delete ( group.add ( cb ) ) ; cb = com.google.gerrit.client.rpc.CallbackGroup.emptyCallback ( ) ; } group.done ( ) ; }

Target:
public static void deleteBranches ( com.google.gerrit.reviewdb.client.Project.NameKey name , java.util.Set < java.lang.String > refs , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > cb ) { com.google.gerrit.client.rpc.CallbackGroup group = new com.google.gerrit.client.rpc.CallbackGroup ( ) ; for ( java.lang.String ref : refs ) { com.google.gerrit.client.projects.ProjectApi.project ( name ) . view ( "branches" ) . id ( ref ) . delete ( group.add ( cb ) ) ; cb = com.google.gerrit.client.rpc.CallbackGroup.emptyCallback ( ) ; } group.done ( ) ; }
Source:
public java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > byCommitsOnBranchNotMerged ( com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.util.List < java.lang.String > hashes ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema = com.google.gerrit.server.query.change.InternalChangeQuery.schema ( indexes ) ; int batchSize ; if ( ( schema != null ) && ( schema.hasField ( ChangeField.EXACT_COMMIT ) ) ) { batchSize = ( indexConfig.maxTerms ( ) ) - 3 ; } else { batchSize = indexConfig.maxPrefixTerms ( ) ; } return byCommitsOnBranchNotMerged ( schema , branch , hashes , batchSize ) ; }

Target:
private java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > byCommitsOnBranchNotMergedFromIndex ( com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.util.List < java.lang.String > hashes ) throws com.google.gwtorm.server.OrmException { return query ( com.google.gerrit.server.query.Predicate.and ( com.google.gerrit.server.query.change.InternalChangeQuery.ref ( branch ) , com.google.gerrit.server.query.change.InternalChangeQuery.project ( branch.getParentKey ( ) ) , com.google.gerrit.server.query.Predicate.not ( com.google.gerrit.server.query.change.InternalChangeQuery.status ( Change.Status.MERGED ) ) , com.google.gerrit.server.query.Predicate.or ( com.google.gerrit.server.query.change.InternalChangeQuery.commits ( com.google.gerrit.server.query.change.InternalChangeQuery.schema ( indexes ) , hashes ) ) ) ) ; }
Source:
public void setUpMocks ( ) { HEAD ( e448b8 ) ; com.ericsson.gerrit.plugins.highavailability.forwarder.rest.Update bazlets ; latest ( revision ) ; servlet = new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexAccountRestApiServlet ( indexer ) ; id = Account.Id.tryParse ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexAccountRestApiServletTest.ACCOUNT_NUMBER ) . get ( ) ; org.mockito.Mockito.when ( req.getPathInfo ( ) ) . thenReturn ( ( "/index/account/" + ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexAccountRestApiServletTest.ACCOUNT_NUMBER ) ) ) ; }

Target:
public void setUpMocks ( ) { servlet = new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexAccountRestApiServlet ( indexerMock ) ; id = Account.Id.tryParse ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexAccountRestApiServletTest.ACCOUNT_NUMBER ) . get ( ) ; org.mockito.Mockito.when ( requestMock.getPathInfo ( ) ) . thenReturn ( ( "/index/account/" + ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexAccountRestApiServletTest.ACCOUNT_NUMBER ) ) ) ; }
Source:
private void addToImportedUsersGroup ( com.google.gerrit.reviewdb.client.Account.Id id ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.AccountGroup group = getImportedUsersGroup ( ) ; com.google.gerrit.reviewdb.client.AccountGroupMember member = new com.google.gerrit.reviewdb.client.AccountGroupMember ( new com.google.gerrit.reviewdb.client.AccountGroupMember.Key ( id , group.getId ( ) ) ) ; db.get ( ) . accountGroupMembers ( ) . insert ( java.util.Collections.singleton ( member ) ) ; }

Target:
private void addToImportedUsersGroup ( com.google.gerrit.reviewdb.client.Account.Id id ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.extensions.api.groups.GroupApi importedUsers ; try { importedUsers = gApi.groups ( ) . id ( com.googlesource.gerrit.plugins.importer.AccountUtil.IMPORTED_USERS ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceNotFoundException e ) { importedUsers = gApi.groups ( ) . create ( com.googlesource.gerrit.plugins.importer.AccountUtil.IMPORTED_USERS ) ; } importedUsers.addMembers ( java.lang.Integer.toString ( id.get ( ) ) ) ; }
Source:
boolean deleteFromIndex ( int changeId ) { try { com.ericsson.gerrit.plugins.highavailability.IndexResponseHandler.IndexResult result = httpSession.delete ( buildEndpoint ( changeId ) ) ; if ( result.isSuccessful ( ) ) { return true ; } com.ericsson.gerrit.plugins.highavailability.RestSession.log.error ( "Unable to delete from index change {}. Cause: {}" , changeId , result.getMessage ( ) ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.RestSession.log.error ( ( "Error trying to delete from index change " + changeId ) , e ) ; } return false ; }

Target:
boolean deleteFromIndex ( int changeId ) { try { com.ericsson.gerrit.plugins.highavailability.HttpResponseHandler.HttpResult result = httpSession.delete ( buildEndpoint ( changeId ) ) ; if ( result.isSuccessful ( ) ) { return true ; } com.ericsson.gerrit.plugins.highavailability.RestSession.log.error ( "Unable to delete from index change {}. Cause: {}" , changeId , result.getMessage ( ) ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.RestSession.log.error ( ( "Error trying to delete from index change " + changeId ) , e ) ; } return false ; }
Source:
public com.google.gerrit.server.account.GetEmails.EmailInfo apply ( com.google.gerrit.server.account.AccountResource.Email rsrc ) { com.google.gerrit.server.account.GetEmails.EmailInfo e = new com.google.gerrit.server.account.GetEmails.EmailInfo ( ) ; e.email = rsrc.getEmail ( ) ; e.setPreferred ( rsrc.getEmail ( ) . equals ( rsrc.getUser ( ) . getAccount ( ) . getPreferredEmail ( ) ) ) ; return e ; }

Target:
public com.google.gerrit.server.account.GetEmails.EmailInfo apply ( com.google.gerrit.server.account.AccountResource.Email rsrc ) { com.google.gerrit.server.account.GetEmails.EmailInfo e = new com.google.gerrit.server.account.GetEmails.EmailInfo ( ) ; e.email = rsrc.getEmail ( ) ; e.preferred ( rsrc.getUser ( ) . getAccount ( ) . getPreferredEmail ( ) ) ; return e ; }