auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void createChangeOnInvisibleBranchFails ( ) throws java.lang.Exception { changeInTwoBranches ( "invisible-branch" , "a.txt" , "branchB" , "b.txt" ) ; block ( com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/invisible-branch" , project ) ; com.google.gerrit.extensions.common.ChangeInput in = newChangeInput ( ChangeStatus.NEW ) ; in.branch = "invisible-branch" ; assertCreateFails ( in , com.google.gerrit.extensions.restapi.AuthException.class , "cannot upload review" ) ; }

Target:
public void createChangeOnInvisibleBranchFails ( ) throws java.lang.Exception { changeInTwoBranches ( "invisible-branch" , "a.txt" , "branchB" , "b.txt" ) ; block ( project , "refs/heads/invisible-branch" , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; com.google.gerrit.extensions.common.ChangeInput in = newChangeInput ( ChangeStatus.NEW ) ; in.branch = "invisible-branch" ; assertCreateFails ( in , com.google.gerrit.extensions.restapi.ResourceNotFoundException.class , "" ) ; }
Source:
public void deleteReviewerFromWipChangeNotifyAll ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; removeReviewer ( sc , extraReviewer , NotifyHandling.ALL ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . notTo ( sc.owner ) . to ( extraReviewer ) . cc ( extraCcer , sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteReviewerWithApprovalFromWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChangeWithExtraReviewer ( ) ; setApiUser ( extraReviewer ) ; gApi.changes ( ) . id ( sc.changeId ) . revision ( "current" ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.recommend ( ) ) ; sender.clear ( ) ; setApiUser ( sc.owner ) ; removeReviewer ( sc , extraReviewer ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . to ( extraReviewer ) . noOneElse ( ) ; }
Source:
private static boolean onSupportedJavaVersion ( ) { final java.lang.String version = java.lang.System.getProperty ( "java.specification.version" ) ; if ( 1.6 <= ( Main.parse ( version ) ) ) { return true ; } else { java.lang.System.err.println ( "fatal: Gerrit Code Review requires Java 6 or later" ) ; java.lang.System.err.println ( ( ( " (trying to run on Java " + version ) + ")" ) ) ; return false ; } }

Target:
private static boolean onSupportedJavaVersion ( ) { final java.lang.String version = java.lang.System.getProperty ( "java.specification.version" ) ; if ( 1.7 <= ( Main.parse ( version ) ) ) { return true ; } else { java.lang.System.err.println ( "fatal: Gerrit Code Review requires Java 7 or later" ) ; java.lang.System.err.println ( ( ( " (trying to run on Java " + version ) + ")" ) ) ; return false ; } }
Source:
protected java.lang.String getNameFor ( final com.google.gerrit.reviewdb.Account.Id accountId ) { if ( accountId == null ) { return "Anonymous Coward" ; } final com.google.gerrit.reviewdb.Account userAccount = args.accountCache.get ( accountId ) . getAccount ( ) ; java.lang.String name = userAccount.getFullName ( ) ; if ( name == null ) { name = userAccount.getPreferredEmail ( ) ; } if ( name == null ) { name = "Anonymous Coward #" + accountId ; } return name ; }

Target:
protected java.lang.String getNameFor ( final com.google.gerrit.reviewdb.Account.Id accountId ) { if ( accountId == null ) { return "Anonymous Coward" ; } com.google.gerrit.reviewdb.Account userAccount = com.google.gerrit.server.util.FutureUtil.get ( args.accountCache.getAccount ( accountId ) ) ; java.lang.String name = userAccount.getFullName ( ) ; if ( name == null ) { name = userAccount.getPreferredEmail ( ) ; } if ( name == null ) { name = "Anonymous Coward #" + accountId ; } return name ; }
Source:
public static void setUsername ( java.lang.String account , java.lang.String username , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.rpc.NativeString > cb ) { com.google.gerrit.client.account.AccountApi.UsernameInput input = com.google.gerrit.client.account.AccountApi.UsernameInput.create ( ) ; input.username ( username ) ; new com.google.gerrit.client.rpc.RestApi ( "/accounts/" ) . id ( account ) . view ( "username" ) . put ( input , cb ) ; }

Target:
public static void setUsername ( java.lang.String account , java.lang.String username , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.rpc.NativeString > cb ) { com.google.gerrit.client.account.AccountApi.UsernameInput input = com.google.gerrit.client.account.AccountApi.UsernameInput.create ( ) ; input.username ( username ) ; com.google.gerrit.client.account.AccountApi.accounts ( ) . id ( account ) . view ( "username" ) . put ( input , cb ) ; }
Source:
private java.lang.String extractWhat ( com.google.gerrit.sshd.DispatchCommand dcmd ) { if ( dcmd == null ) { return "Command was already destroyed" ; } java.lang.StringBuilder commandName = new java.lang.StringBuilder ( dcmd.getCommandName ( ) ) ; java.lang.String [ ] trimmedArgs = dcmd.getTrimmedArguments ( ) ; if ( trimmedArgs != null ) { commandName.append ( com.google.common.base.Joiner.on ( "." ) . join ( trimmedArgs ) ) ; } return commandName.toString ( ) ; }

Target:
private java.lang.String extractWhat ( com.google.gerrit.sshd.DispatchCommand dcmd ) { if ( dcmd == null ) { return "Command was already destroyed" ; } java.lang.StringBuilder commandName = new java.lang.StringBuilder ( dcmd.getCommandName ( ) ) ; java.lang.String [ ] args = dcmd.getArguments ( ) ; for ( int i = 1 ; i < ( args.length ) ; i ++ ) { commandName.append ( "." ) . append ( args [ i ] ) ; } return commandName.toString ( ) ; }
Source:
private static com.google.gitiles.CommitJsonData.Ident toJsonData ( org.eclipse.jgit.lib.PersonIdent ident ) { com.google.gitiles.CommitJsonData.Ident result = new com.google.gitiles.CommitJsonData.Ident ( ) ; result.name = ident.getName ( ) ; result.email = ident.getEmailAddress ( ) ; result.time = com.google.gitiles.CommitJsonData.dateFormatter.formatDate ( ident ) ; return result ; }

Target:
private static com.google.gitiles.CommitJsonData.Ident toJsonData ( org.eclipse.jgit.lib.PersonIdent ident , org.eclipse.jgit.util.GitDateFormatter df ) { com.google.gitiles.CommitJsonData.Ident result = new com.google.gitiles.CommitJsonData.Ident ( ) ; result.name = ident.getName ( ) ; result.email = ident.getEmailAddress ( ) ; result.time = df.formatDate ( ident ) ; return result ; }
Source:
public static com.google.common.collect.FluentIterable < java.lang.String > names ( java.lang.Iterable < com.google.gerrit.acceptance.TestAccount > accounts ) { return com.google.common.collect.FluentIterable.from ( accounts ) . transform ( new com.google.common.base.Function < com.google.gerrit.acceptance.TestAccount , java.lang.String > ( ) { @ java.lang.Override public java.lang.String apply ( com.google.gerrit.acceptance.TestAccount in ) { return in.fullName ; } } ) ; }

Target:
public static com.google.common.collect.FluentIterable < java.lang.String > names ( java.lang.Iterable < com.google.gerrit.acceptance.TestAccount > accounts ) { return com.google.common.collect.FluentIterable.from ( accounts ) . transform ( ( a ) -> a.fullName ) ; }
Source:
private void initOnce ( ) { if ( ( pcl ) == null ) pcl = new com.googlecode.prolog_cafe.lang.PrologClassLoader ( ) ; if ( ( internalDB ) == null ) internalDB = new com.googlecode.prolog_cafe.lang.InternalDatabase ( ) ; if ( ( streamManager ) == null ) streamManager = new com.googlecode.prolog_cafe.lang.HashtableOfTerm ( ) ; }

Target:
private void initOnce ( ) { if ( ( pcl ) == null ) pcl = new com.googlecode.prolog_cafe.lang.PrologClassLoader ( ) ; if ( ( internalDB ) == null ) internalDB = new com.googlecode.prolog_cafe.lang.InternalDatabase ( ) ; if ( ( streamManager ) == null ) streamManager = new com.googlecode.prolog_cafe.lang.HashtableOfTerm ( 7 ) ; }
Source:
private void setWebLinks ( com.google.gerrit.client.info.ChangeInfo.RevisionInfo revInfo ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.info.WebLinkInfo > links = revInfo.commit ( ) . webLinks ( ) ; if ( links != null ) { for ( com.google.gerrit.client.info.WebLinkInfo link : com.google.gerrit.client.rpc.Natives.asList ( links ) ) { webLinkPanel.add ( link.toAnchor ( ) ) ; } } }

Target:
private void setWebLinks ( com.google.gwt.user.client.ui.FlowPanel panel , com.google.gerrit.client.info.ChangeInfo.CommitInfo commit ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.info.WebLinkInfo > links = commit.webLinks ( ) ; if ( links != null ) { for ( com.google.gerrit.client.info.WebLinkInfo link : com.google.gerrit.client.rpc.Natives.asList ( links ) ) { panel.add ( link.toAnchor ( ) ) ; } } }
Source:
org.eclipse.jgit.lib.PersonIdent newAuthorIdent ( ) { com.google.gerrit.reviewdb.client.Account.Id id = getAccountId ( ) ; if ( id == null ) { return new org.eclipse.jgit.lib.PersonIdent ( serverIdent , getWhen ( ) ) ; } return changeNoteUtil.newIdent ( accountCache.get ( id ) . getAccount ( ) , getWhen ( ) , serverIdent , anonymousCowardName ) ; }

Target:
private org.eclipse.jgit.lib.PersonIdent newAuthorIdent ( com.google.gerrit.server.notedb.rebuild.EventList < ? > events ) { com.google.gerrit.reviewdb.client.Account.Id id = events.getAccountId ( ) ; if ( id == null ) { return new org.eclipse.jgit.lib.PersonIdent ( serverIdent , events.getWhen ( ) ) ; } return changeNoteUtil.newIdent ( accountCache.get ( id ) . getAccount ( ) , events.getWhen ( ) , serverIdent , anonymousCowardName ) ; }
Source:
private static boolean isInternalGroup ( com.google.gerrit.common.data.GroupDescription.Basic group ) { return group instanceof com.google.gerrit.common.data.GroupDescription.Internal ; }

Target:
private com.google.gerrit.extensions.common.GroupInfo createGroupInfo ( com.google.gerrit.common.data.GroupDescription.Basic group , java.util.function.Supplier < com.google.gerrit.server.account.GroupControl > groupControlSupplier ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.extensions.common.GroupInfo info = com.google.gerrit.server.group.GroupJson.createBasicGroupInfo ( group ) ; if ( group instanceof com.google.gerrit.common.data.GroupDescription.Internal ) { addInternalDetails ( info , ( ( com.google.gerrit.common.data.GroupDescription.Internal ) ( group ) ) , groupControlSupplier ) ; } return info ; }
Source:
public void stop ( ) { if ( ( listeners ) != null ) { for ( int i = ( listeners.length ) - 1 ; 0 <= i ; i -- ) { final com.google.gerrit.lifecycle.LifecycleListener obj = listeners [ i ] ; try { obj.stop ( ) ; } catch ( java.lang.Throwable err ) { org.slf4j.LoggerFactory.getLogger ( obj.getClass ( ) ) . warn ( "Failed to stop" , err ) ; } } listeners = null ; } }

Target:
public void start ( ) { if ( ! ( started ) ) { started = true ; for ( com.google.gerrit.lifecycle.LifecycleListener obj : listeners.keySet ( ) ) { obj.start ( ) ; } } }
Source:
private com.google.gerrit.reviewdb.client.ChangeMessage newMessage ( com.google.gerrit.server.update.BatchUpdate.ChangeContext ctx ) { java.lang.StringBuilder msg = new java.lang.StringBuilder ( ) ; msg.append ( "Abandoned" ) ; if ( ! ( com.google.common.base.Strings.nullToEmpty ( msgTxt ) . trim ( ) . isEmpty ( ) ) ) { msg.append ( "\n\n" ) ; msg.append ( msgTxt.trim ( ) ) ; } return com.google.gerrit.server.ChangeMessagesUtil.newMessage ( ctx , msg.toString ( ) , ChangeMessagesUtil.TAG_ABANDON ) ; }

Target:
private com.google.gerrit.reviewdb.client.ChangeMessage newMessage ( com.google.gerrit.server.update.ChangeContext ctx ) { java.lang.StringBuilder msg = new java.lang.StringBuilder ( ) ; msg.append ( "Abandoned" ) ; if ( ! ( com.google.common.base.Strings.nullToEmpty ( msgTxt ) . trim ( ) . isEmpty ( ) ) ) { msg.append ( "\n\n" ) ; msg.append ( msgTxt.trim ( ) ) ; } return com.google.gerrit.server.ChangeMessagesUtil.newMessage ( ctx , msg.toString ( ) , ChangeMessagesUtil.TAG_ABANDON ) ; }
Source:
protected void populateProjects ( ) { final java.lang.String mySubname = subname ; com.google.gerrit.client.projects.ProjectMap.match ( subname , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.projects.ProjectMap > ( ) { @ java.lang.Override public void onSuccess ( final com.google.gerrit.client.projects.ProjectMap result ) { if ( ( ( mySubname == null ) && ( ( subname ) == null ) ) || ( ( mySubname != null ) && ( mySubname.equals ( subname ) ) ) ) { display ( result ) ; } } } ) ; }

Target:
protected void populateProjects ( ) { com.google.gerrit.client.projects.ProjectMap.match ( subname , new com.google.gerrit.client.ui.IgnoreOutdatedFilterResultsCallbackWrapper < com.google.gerrit.client.projects.ProjectMap > ( this , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.projects.ProjectMap > ( ) { @ java.lang.Override public void onSuccess ( final com.google.gerrit.client.projects.ProjectMap result ) { projectsTab.display ( result , subname ) ; if ( firstPopupLoad ) { firstPopupLoad = false ; displayPopup ( ) ; } } } ) ) ; }
Source:
private void update ( org.eclipse.jgit.revwalk.RevCommit rev ) throws java.lang.Exception { org.eclipse.jgit.lib.RefUpdate u = db.updateRef ( RefNames.REFS_CONFIG ) ; u.disableRefLog ( ) ; u.setNewObjectId ( rev ) ; org.eclipse.jgit.lib.RefUpdate.Result result = u.forceUpdate ( ) ; com.google.common.truth.Truth.assert_ ( ) . withMessage ( ( "Cannot update ref for test: " + result ) ) . that ( result ) . isAnyOf ( Result.FAST_FORWARD , Result.FORCED , Result.NEW , Result.NO_CHANGE ) ; }

Target:
private void update ( org.eclipse.jgit.revwalk.RevCommit rev ) throws java.lang.Exception { org.eclipse.jgit.lib.RefUpdate u = db.updateRef ( RefNames.REFS_CONFIG ) ; u.disableRefLog ( ) ; u.setNewObjectId ( rev ) ; org.eclipse.jgit.lib.RefUpdate.Result result = u.forceUpdate ( ) ; com.google.common.truth.Truth.assertWithMessage ( ( "Cannot update ref for test: " + result ) ) . that ( result ) . isAnyOf ( Result.FAST_FORWARD , Result.FORCED , Result.NEW , Result.NO_CHANGE ) ; }
Source:
public boolean hasRepositoryPermission ( java.lang.String name ) { boolean result = false ; try { name = getRepositoryName ( name ) ; com.google.gerrit.server.project.ProjectControl control = projectControlFactory.validateFor ( new com.google.gerrit.reviewdb.client.Project.NameKey ( name ) ) ; result = ( control != null ) && ( control.isVisible ( ) ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { result = false ; } return result ; }

Target:
public boolean hasRepositoryPermission ( java.lang.String name ) { boolean result = false ; try { name = getRepositoryName ( name ) ; com.google.gerrit.server.project.ProjectControl control = projectControlFactory.controlFor ( new com.google.gerrit.reviewdb.client.Project.NameKey ( name ) ) ; result = ( control != null ) && ( ! ( control.isHidden ( ) ) ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { result = false ; } return result ; }
Source:
public void testReplaceInOrder ( ) { com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.html ( "A\nissue 42\nReally GWTEXPUI-9918 is better\nB" ) ; com.google.gwtexpui.safehtml.client.SafeHtml n = o.replaceAll ( com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.repls ( new com.google.gwtexpui.safehtml.client.RawFindReplace ( "(GWTEXPUI-(\\d+))" , "<a href=\"gwtexpui-bug?$2\">$1</a>" ) , new com.google.gwtexpui.safehtml.client.RawFindReplace ( "(issue\\s+(\\d+))" , "<a href=\"generic-bug?$2\">$1</a>" ) ) ) ; org.junit.Assert.assertNotSame ( o , n ) ; org.junit.Assert.assertEquals ( ( "A\n" + ( ( "<a href=\"generic-bug?42\">issue 42</a>\n" + "Really <a href=\"gwtexpui-bug?9918\">GWTEXPUI-9918</a> is better\n" ) + "B" ) ) , n.asString ( ) ) ; }

Target:
public void testReplaceInOrder ( ) { com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.html ( "A\nissue 42\nReally GWTEXPUI-9918 is better\nB" ) ; com.google.gwtexpui.safehtml.client.SafeHtml n = o.replaceAll ( com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.repls ( new com.google.gwtexpui.safehtml.client.RawFindReplace ( "(GWTEXPUI-(\\d+))" , "<a href=\"gwtexpui-bug?$2\">$1</a>" ) , new com.google.gwtexpui.safehtml.client.RawFindReplace ( "(issue\\s+(\\d+))" , "<a href=\"generic-bug?$2\">$1</a>" ) ) ) ; com.google.common.truth.Truth.assertThat ( o ) . isNotSameAs ( n ) ; com.google.common.truth.Truth.assertThat ( n.asString ( ) ) . isEqualTo ( ( "A\n" + ( ( "<a href=\"generic-bug?42\">issue 42</a>\n" + "Really <a href=\"gwtexpui-bug?9918\">GWTEXPUI-9918</a> is better\n" ) + "B" ) ) ) ; }
Source:
public void notifyRefReplicated ( java.lang.String project , java.lang.String ref , org.eclipse.jgit.transport.URIish uri , com.googlesource.gerrit.plugins.replication.ReplicationState.RefPushResult status ) { pushResultProcessing.onOneNodeReplicated ( project , ref , uri , status ) ; countingLock.lock ( ) ; try { ( finishedPushTasksCount ) ++ ; if ( ! ( allScheduled ) ) { return ; } if ( ( finishedPushTasksCount ) < ( totalPushTasksCount ) ) { return ; } } finally { countingLock.unlock ( ) ; } doAllPushTasksCompleted ( ) ; }

Target:
private void doAllPushTasksCompleted ( ) { fireRemainingOnRefReplicatedToAllNodes ( ) ; pushResultProcessing.onAllRefsReplicatedToAllNodes ( totalPushTasksCount ) ; allPushTasksFinished.countDown ( ) ; }
Source:
public com.google.gerrit.client.ui.InlineHyperlink getNextPatchLink ( int index , com.google.gerrit.client.patches.PatchScreen.Type patchType ) { for ( index ++ ; index < ( patchList.size ( ) ) ; index ++ ) { com.google.gerrit.client.ui.InlineHyperlink link = createLink ( index , patchType , null , com.google.gwtexpui.safehtml.client.SafeHtml.asis ( Util.C.nextPatchLinkIcon ( ) ) ) ; if ( link != null ) { return link ; } } return null ; }

Target:
public com.google.gerrit.client.ui.InlineHyperlink getPreviousPatchLink ( int index , com.google.gerrit.client.patches.PatchScreen.Type patchType ) { int previousPatchIndex = getPreviousPatch ( index , PREFERENCE_VALIDATOR ) ; if ( previousPatchIndex < 0 ) { return null ; } com.google.gerrit.client.ui.InlineHyperlink link = createLink ( previousPatchIndex , patchType , com.google.gwtexpui.safehtml.client.SafeHtml.asis ( Util.C.prevPatchLinkIcon ( ) ) , null ) ; return link ; }
Source:
public void deleteReviewerFromWipChangeNotifyAll ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; removeReviewer ( sc , extraReviewer , NotifyHandling.ALL ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . notTo ( sc.owner ) . to ( extraReviewer ) . cc ( extraCcer , sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteReviewerFromWipChangeNotifyAll ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChangeWithExtraReviewer ( ) ; removeReviewer ( sc , extraReviewer , NotifyHandling.ALL ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . to ( extraReviewer ) . cc ( extraCcer , sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) . noOneElse ( ) ; }
Source:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.validators.ProjectCreationValidationListener.class ) . to ( com.googlesource.gerrit.plugins.quota.MaxRepositoriesQuotaValidator.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.git.ReceivePackInitializer.class ) . to ( com.googlesource.gerrit.plugins.quota.MaxRepositorySizeQuota.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , org.eclipse.jgit.transport.PostReceiveHook.class ) . to ( com.googlesource.gerrit.plugins.quota.MaxRepositorySizeQuota.class ) ; install ( com.googlesource.gerrit.plugins.quota.MaxRepositorySizeQuota.module ( ) ) ; }

Target:
protected void configure ( ) { get ( com.google.gerrit.server.project.ProjectResource.PROJECT_KIND , "quota" ) . to ( com.googlesource.gerrit.plugins.quota.GetQuota.class ) ; }
Source:
private static void assertInvalid ( final java.lang.String in ) { try { com.google.gerrit.server.mail.Address.parse ( in ) ; org.junit.Assert.fail ( ( "Incorrectly accepted " + in ) ) ; } catch ( java.lang.IllegalArgumentException e ) { org.junit.Assert.assertEquals ( ( "Invalid email address: " + in ) , e.getMessage ( ) ) ; } }

Target:
private void assertInvalid ( final java.lang.String in ) { exception.expect ( java.lang.IllegalArgumentException.class ) ; exception.expectMessage ( ( "Invalid email address: " + in ) ) ; com.google.gerrit.server.mail.Address.parse ( in ) ; }
Source:
public java.util.List < com.google.gerrit.extensions.common.ProjectInfo > children ( boolean recursive ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.project.ListChildProjects list = children.list ( ) ; list.setRecursive ( recursive ) ; try { return list.apply ( checkExists ( ) ) ; } catch ( com.google.gerrit.server.permissions.PermissionBackendException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot list children" , e ) ; } }

Target:
public java.util.List < com.google.gerrit.extensions.common.ProjectInfo > children ( boolean recursive ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.project.ListChildProjects list = children.list ( ) ; list.setRecursive ( recursive ) ; try { return list.apply ( checkExists ( ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot list children" , e ) ; } }
Source:
private void setUpPermissions ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig pc = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; for ( com.google.gerrit.common.data.AccessSection sec : pc.getAccessSections ( ) ) { sec.removePermission ( Permission.READ ) ; } com.google.gerrit.server.project.Util.allow ( pc , Permission.READ , admins , "refs/*" ) ; saveProjectConfig ( allProjects , pc ) ; }

Target:
private void setUpPermissions ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig pc = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; for ( com.google.gerrit.common.data.AccessSection sec : pc.getAccessSections ( ) ) { sec.removePermission ( Permission.READ ) ; } com.google.gerrit.server.project.testing.Util.allow ( pc , Permission.READ , admins , "refs/*" ) ; saveProjectConfig ( allProjects , pc ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { allowGlobalCapabilities ( com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , com.googlesource.gerrit.plugins.verifystatus.SaveReportCapability.getName ( pluginName ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; allowGlobalCapabilities ( com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , com.googlesource.gerrit.plugins.verifystatus.SaveReportCapability.getName ( com.googlesource.gerrit.plugins.verifystatus.VerifyStatusIT.NAME ) ) ; java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , "org.h2.Driver" ) ; p.setProperty ( "url" , com.googlesource.gerrit.plugins.verifystatus.VerifyStatusIT.URL ) ; com.google.gwtorm.jdbc.SimpleDataSource sds = new com.google.gwtorm.jdbc.SimpleDataSource ( p ) ; try ( java.sql.Connection c = sds.getConnection ( ) ; java.sql.Statement s = c.createStatement ( ) ) { s.executeUpdate ( com.googlesource.gerrit.plugins.verifystatus.VerifyStatusIT.CREATE_TABLE ) ; s.execute ( com.googlesource.gerrit.plugins.verifystatus.VerifyStatusIT.DELETE_TABLE ) ; } }
Source:
private void initUserAuth ( final org.apache.sshd.server.PublickeyAuthenticator pubkey ) { setUserAuthFactories ( java.util.Arrays.< org.apache.sshd.common.NamedFactory < org.apache.sshd.server.UserAuth > > asList ( new org.apache.sshd.server.auth.UserAuthPublicKey.Factory ( ) ) ) ; setPublickeyAuthenticator ( pubkey ) ; }

Target:
private void initUserAuth ( final org.apache.sshd.server.PasswordAuthenticator pass , final org.apache.sshd.server.PublickeyAuthenticator pubkey ) { setUserAuthFactories ( java.util.Arrays.< org.apache.sshd.common.NamedFactory < org.apache.sshd.server.UserAuth > > asList ( new org.apache.sshd.server.auth.UserAuthPublicKey.Factory ( ) , new org.apache.sshd.server.auth.UserAuthPassword.Factory ( ) ) ) ; setPasswordAuthenticator ( pass ) ; setPublickeyAuthenticator ( pubkey ) ; }
Source:
private com.google.gerrit.reviewdb.client.ChangeMessage newMessage ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) { java.lang.StringBuilder msg = new java.lang.StringBuilder ( ) ; msg.append ( "Restored" ) ; if ( ! ( com.google.common.base.Strings.nullToEmpty ( input.message ) . trim ( ) . isEmpty ( ) ) ) { msg.append ( "\n\n" ) ; msg.append ( input.message.trim ( ) ) ; } return com.google.gerrit.server.ChangeMessagesUtil.newMessage ( ctx , msg.toString ( ) , ChangeMessagesUtil.TAG_RESTORE ) ; }

Target:
private com.google.gerrit.reviewdb.client.ChangeMessage newMessage ( com.google.gerrit.server.update.ChangeContext ctx ) { java.lang.StringBuilder msg = new java.lang.StringBuilder ( ) ; msg.append ( "Restored" ) ; if ( ! ( com.google.common.base.Strings.nullToEmpty ( input.message ) . trim ( ) . isEmpty ( ) ) ) { msg.append ( "\n\n" ) ; msg.append ( input.message.trim ( ) ) ; } return com.google.gerrit.server.ChangeMessagesUtil.newMessage ( ctx , msg.toString ( ) , ChangeMessagesUtil.TAG_RESTORE ) ; }
Source:
public void onShowView ( ) { super . onShowView ( ) ; resizeCodeMirror ( ) ; com.google.gwt.user.client.Window.enableScrolling ( false ) ; cmA.setOption ( "viewportMargin" , 10 ) ; cmB.setOption ( "viewportMargin" , 10 ) ; cmB.setCursor ( net.codemirror.lib.LineCharacter.create ( 0 ) ) ; cmB.focus ( ) ; prefetchNextFile ( ) ; }

Target:
public void onShowView ( ) { super . onShowView ( ) ; com.google.gwt.user.client.Window.enableScrolling ( false ) ; final int height = getCodeMirrorHeight ( ) ; onShowView ( cmA , height ) ; onShowView ( cmB , height ) ; diffTable.sidePanel.adjustGutters ( cmB ) ; cmB.setCursor ( net.codemirror.lib.LineCharacter.create ( 0 ) ) ; cmB.focus ( ) ; prefetchNextFile ( ) ; }
Source:
public void clientError ( java.lang.String message , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwtjsonrpc.client.VoidResult > callback ) { javax.servlet.http.HttpServletRequest r = httpRequest.get ( ) ; java.lang.String ua = r.getHeader ( "User-Agent" ) ; message = message.replaceAll ( "\n" , "\n " ) ; com.google.gerrit.httpd.rpc.SystemInfoServiceImpl.log.error ( ( ( ( "Client UI JavaScript error: User-Agent=" + ua ) + ": " ) + message ) ) ; callback.onSuccess ( VoidResult.INSTANCE ) ; }

Target:
public void clientError ( java.lang.String message , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gwtjsonrpc.common.VoidResult > callback ) { javax.servlet.http.HttpServletRequest r = httpRequest.get ( ) ; java.lang.String ua = r.getHeader ( "User-Agent" ) ; message = message.replaceAll ( "\n" , "\n " ) ; com.google.gerrit.httpd.rpc.SystemInfoServiceImpl.log.error ( ( ( ( "Client UI JavaScript error: User-Agent=" + ua ) + ": " ) + message ) ) ; callback.onSuccess ( VoidResult.INSTANCE ) ; }
Source:
public void onPreMerge ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.git.CodeReviewCommit commit ) { }

Target:
public void onPreMerge ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.git.CodeReviewCommit commit , com.google.gerrit.server.project.ProjectState destProject , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , com.google.gerrit.server.IdentifiedUser caller ) throws com.google.gerrit.server.git.validators.MergeValidationException { if ( ! ( caller.getCapabilities ( ) . canAdministrateServer ( ) ) ) { throw new com.google.gerrit.server.git.validators.MergeValidationException ( ( ( "Submitter " + ( caller.getNameEmail ( ) ) ) + " is not a site administrator" ) ) ; } }
Source:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.project.ProjectResource project , com.google.gerrit.extensions.api.projects.DeleteBranchesInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( ( ( input == null ) || ( ( input.branches ) == null ) ) || ( input.branches.isEmpty ( ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "branches must be specified" ) ; } HEAD ( 1.0F ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.project.ProjectResource project , com.google.gerrit.extensions.api.projects.DeleteBranchesInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( ( ( input == null ) || ( ( input.branches ) == null ) ) || ( input.branches.isEmpty ( ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "branches must be specified" ) ; } deleteRefFactory.create ( project ) . refs ( input.branches ) . prefix ( org.eclipse.jgit.lib.Constants.R_HEADS ) . delete ( ) ; return com.google.gerrit.extensions.restapi.Response.none ( ) ; }
Source:
public void listEmptyGroupIncludes ( ) throws java.lang.Exception { java.lang.String gx = group ( "gx" , "Administrators" ) ; PUT ( ( ( ( "/groups/" + gx ) + "/groups/" ) + ( name ( "emptygroup" ) ) ) ) ; com.google.common.truth.Truth.assertThat ( GET ( "/groups/Administrators/groups/" ) ) . isEmpty ( ) ; }

Target:
public void includeNonExistingGroup ( ) throws java.lang.Exception { java.lang.String gx = group ( "gx" ) ; try { gApi.groups ( ) . id ( gx ) . addGroups ( "non-existing" ) ; } catch ( com.google.gerrit.extensions.restapi.UnprocessableEntityException expecetd ) { } }
Source:
public void testVerifyAgainstDifferentOperation ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.lfs.AuthInfo info = auth.generateAuthInfo ( "o" , org.eclipse.jgit.lfs.lib.LongObjectId.zeroId ( ) , 1 ) ; com.google.common.truth.Truth.assertThat ( auth.verifyAuthInfo ( info.authToken , "p" , org.eclipse.jgit.lfs.lib.LongObjectId.zeroId ( ) ) ) . isFalse ( ) ; }

Target:
public void testVerifyAgainstDifferentOperation ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.lfs.AuthInfo info = auth.generateAuthInfo ( "o" , org.eclipse.jgit.lfs.lib.LongObjectId.zeroId ( ) , java.time.Instant.now ( ) , 1L ) ; com.google.common.truth.Truth.assertThat ( auth.verifyAuthInfo ( info.authToken ( ) , "p" , org.eclipse.jgit.lfs.lib.LongObjectId.zeroId ( ) ) ) . isFalse ( ) ; }
Source:
public boolean isReviewer ( com.google.gerrit.reviewdb.server.ReviewDb db , @ com.google.gerrit.common.Nullable com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( getCurrentUser ( ) . isIdentifiedUser ( ) ) { java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > results = changeData ( db , cd ) . reviewers ( ) . values ( ) ; com.google.gerrit.server.IdentifiedUser user = ( ( com.google.gerrit.server.IdentifiedUser ) ( getCurrentUser ( ) ) ) ; return results.contains ( user.getAccountId ( ) ) ; } return false ; }

Target:
public boolean isReviewer ( com.google.gerrit.reviewdb.server.ReviewDb db , @ com.google.gerrit.common.Nullable com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( getUser ( ) . isIdentifiedUser ( ) ) { java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > results = changeData ( db , cd ) . reviewers ( ) . values ( ) ; com.google.gerrit.server.IdentifiedUser user = ( ( com.google.gerrit.server.IdentifiedUser ) ( getUser ( ) ) ) ; return results.contains ( user.getAccountId ( ) ) ; } return false ; }
Source:
private com.google.common.base.Optional < com.google.gerrit.server.plugins.PluginEntry > resourceOf ( java.lang.String resourcePath ) { java.io.File file = getResourceFile ( resourcePath ) ; if ( ( file.exists ( ) ) && ( ( file.length ( ) ) > 0 ) ) { return com.google.common.base.Optional.of ( new com.google.gerrit.server.plugins.PluginEntry ( resourcePath , file.lastModified ( ) , file.length ( ) ) ) ; } else { return com.google.common.base.Optional.absent ( ) ; } }

Target:
public java.util.Enumeration < com.google.gerrit.server.plugins.PluginEntry > entries ( ) { return webScanner.entries ( ) ; }
Source:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { try { if ( versionManager.startReindexer ( name , force ) ) { stdout.println ( "Reindexer started" ) ; } else { stdout.println ( "Nothing to reindex, index is already the latest version" ) ; } } catch ( com.google.gerrit.server.index.ReindexerAlreadyRunningException e ) { throw die ( ( "Failed to start reindexer: " + ( e.getMessage ( ) ) ) ) ; } }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { try { if ( versionManager.isKnownIndex ( name ) ) { if ( versionManager.startReindexer ( name , force ) ) { stdout.println ( "Reindexer started" ) ; } else { stdout.println ( "Nothing to reindex, index is already the latest version" ) ; } } else { stderr.println ( "Cannot reindex, index is unknown based on this name" ) ; } } catch ( com.google.gerrit.server.index.ReindexerAlreadyRunningException e ) { throw die ( ( "Failed to start reindexer: " + ( e.getMessage ( ) ) ) ) ; } }
Source:
private void enableForm ( final boolean canModifyAgreements , final boolean canModifyDescription , final boolean canModifyMergeType ) { submitType.setEnabled ( canModifyMergeType ) ; descTxt.setEnabled ( canModifyDescription ) ; useContributorAgreements.setEnabled ( canModifyAgreements ) ; useSignedOffBy.setEnabled ( canModifyAgreements ) ; saveProject.setEnabled ( ( ( canModifyAgreements || canModifyDescription ) || canModifyMergeType ) ) ; }

Target:
private void enableForm ( final boolean canModifyAgreements , final boolean canModifyDescription , final boolean canModifyMergeType ) { submitType.setEnabled ( canModifyMergeType ) ; descTxt.setEnabled ( canModifyDescription ) ; useContributorAgreements.setEnabled ( canModifyAgreements ) ; useSignedOffBy.setEnabled ( canModifyAgreements ) ; requireChangeID.setEnabled ( canModifyMergeType ) ; saveProject.setEnabled ( ( ( canModifyAgreements || canModifyDescription ) || canModifyMergeType ) ) ; }
Source:
private static java.util.List < org.eclipse.jgit.transport.RemoteConfig > allRemotes ( org.eclipse.jgit.storage.file.FileBasedConfig cfg ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.util.Set < java.lang.String > names = cfg.getSubsections ( "remote" ) ; java.util.List < org.eclipse.jgit.transport.RemoteConfig > result = com.google.common.collect.Lists.newArrayListWithCapacity ( names.size ( ) ) ; for ( java.lang.String name : names ) { try { result.add ( new org.eclipse.jgit.transport.RemoteConfig ( cfg , name ) ) ; } catch ( java.net.URISyntaxException e ) { throw new org.eclipse.jgit.errors.ConfigInvalidException ( java.lang.String.format ( "remote %s has invalid URL in %s" , name , cfg.getFile ( ) ) ) ; } } return result ; }

Target:
private static void deleteRemoteSsh ( org.eclipse.jgit.transport.URIish uri ) { java.lang.String quotedPath = QuotedString.BOURNE.quote ( uri.getPath ( ) ) ; java.lang.String cmd = "rm -rf " + quotedPath ; java.io.OutputStream errStream = com.googlesource.gerrit.plugins.replication.ReplicationQueue.newErrorBufferStream ( ) ; try { com.googlesource.gerrit.plugins.replication.ReplicationQueue.executeRemotSsh ( uri , cmd , errStream ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.log.error ( java.lang.String.format ( ( "Error deleting remote repository at %s:\n" + ( ( " Exception: %s\n" + " Command: %s\n" ) + " Output: %s" ) ) , uri , e , cmd , errStream ) , e ) ; } }
Source:
private com.google.gerrit.server.account.AccountState makeUser ( final java.lang.String name , final java.lang.String email ) { final com.google.gerrit.reviewdb.client.Account.Id userId = new com.google.gerrit.reviewdb.client.Account.Id ( 42 ) ; final com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( userId ) ; account.setFullName ( name ) ; account.setPreferredEmail ( email ) ; final com.google.gerrit.server.account.AccountState s = new com.google.gerrit.server.account.AccountState ( account , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountGroup.UUID > emptySet ( ) , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountExternalId > emptySet ( ) ) ; return s ; }

Target:
private com.google.gerrit.server.account.AccountState makeUser ( final java.lang.String name , final java.lang.String email ) { final com.google.gerrit.reviewdb.client.Account.Id userId = new com.google.gerrit.reviewdb.client.Account.Id ( 42 ) ; final com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( userId , com.google.gerrit.server.util.TimeUtil.nowTs ( ) ) ; account.setFullName ( name ) ; account.setPreferredEmail ( email ) ; final com.google.gerrit.server.account.AccountState s = new com.google.gerrit.server.account.AccountState ( account , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountGroup.UUID > emptySet ( ) , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountExternalId > emptySet ( ) ) ; return s ; }
Source:
public void addSubmitRecords ( com.google.gerrit.server.events.ChangeAttribute ca , java.util.List < com.google.gerrit.common.data.SubmitRecord > submitRecords ) { ca.submitRecords = new java.util.ArrayList < com.google.gerrit.server.events.SubmitRecordAttribute > ( ) ; for ( com.google.gerrit.common.data.SubmitRecord submitRecord : submitRecords ) { com.google.gerrit.server.events.SubmitRecordAttribute sa = new com.google.gerrit.server.events.SubmitRecordAttribute ( ) ; sa.status = submitRecord.status.name ( ) ; if ( ( submitRecord.status ) != ( SubmitRecord.Status.RULE_ERROR ) ) { addSubmitRecordLabels ( submitRecord , sa ) ; } ca.submitRecords.add ( sa ) ; } if ( ca.submitRecords.isEmpty ( ) ) { ca.submitRecords = null ; } }

Target:
public void addSubmitRecords ( com.google.gerrit.server.data.ChangeAttribute ca , java.util.List < com.google.gerrit.common.data.SubmitRecord > submitRecords ) { ca.submitRecords = new java.util.ArrayList < com.google.gerrit.server.data.SubmitRecordAttribute > ( ) ; for ( com.google.gerrit.common.data.SubmitRecord submitRecord : submitRecords ) { com.google.gerrit.server.data.SubmitRecordAttribute sa = new com.google.gerrit.server.data.SubmitRecordAttribute ( ) ; sa.status = submitRecord.status.name ( ) ; if ( ( submitRecord.status ) != ( SubmitRecord.Status.RULE_ERROR ) ) { addSubmitRecordLabels ( submitRecord , sa ) ; } ca.submitRecords.add ( sa ) ; } if ( ca.submitRecords.isEmpty ( ) ) { ca.submitRecords = null ; } }
Source:
private boolean canPushWithForce ( ) { if ( ( GitRepositoryManager.REF_CONFIG.equals ( refName ) ) && ( ! ( getProjectControl ( ) . isOwner ( ) ) ) ) { return false ; } for ( com.google.gerrit.common.data.PermissionRule rule : access ( Permission.PUSH ) ) { if ( rule.getForce ( ) ) { return true ; } } return false ; }

Target:
public boolean canSubmit ( ) { if ( GitRepositoryManager.REF_CONFIG.equals ( refName ) ) { return projectControl.isOwner ( ) ; } return canPerform ( Permission.SUBMIT ) ; }
Source:
private static java.lang.String defaultOf ( com.google.gerrit.reviewdb.client.Project proj ) { final java.lang.String defaultId = com.google.common.base.Objects.firstNonNull ( proj.getLocalDefaultDashboard ( ) , com.google.common.base.Strings.nullToEmpty ( proj.getDefaultDashboard ( ) ) ) ; if ( defaultId.startsWith ( com.google.gerrit.server.git.GitRepositoryManager.REFS_DASHBOARDS ) ) { return defaultId.substring ( com.google.gerrit.server.git.GitRepositoryManager.REFS_DASHBOARDS.length ( ) ) ; } else { return defaultId ; } }

Target:
private static java.lang.String defaultOf ( com.google.gerrit.reviewdb.client.Project proj ) { final java.lang.String defaultId = com.google.common.base.Objects.firstNonNull ( proj.getLocalDefaultDashboard ( ) , com.google.common.base.Strings.nullToEmpty ( proj.getDefaultDashboard ( ) ) ) ; if ( defaultId.startsWith ( com.google.gerrit.reviewdb.client.RefNames.REFS_DASHBOARDS ) ) { return defaultId.substring ( com.google.gerrit.reviewdb.client.RefNames.REFS_DASHBOARDS.length ( ) ) ; } else { return defaultId ; } }
Source:
public void onSend ( ) { Util.MANAGE_SVC.restoreChange ( patchSet.getId ( ) , getMessageText ( ) , createCallback ( ) ) ; }

Target:
public void onSend ( ) { com.google.gerrit.client.changes.ChangeApi.restore ( changeDetail.getChange ( ) . getChangeId ( ) , getMessageText ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { sent = true ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( new com.google.gerrit.reviewdb.client.Change.Id ( result._number ( ) ) ) ) ; hide ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { enableButtons ( true ) ; super . onFailure ( caught ) ; } } ) ; }
Source:
protected void respondWithJobStatusJson ( javax.servlet.http.HttpServletResponse resp , com.googlesrouce.gerrit.plugins.github.git.BatchImporter cloner ) throws java.io.IOException { java.util.Collection < com.googlesrouce.gerrit.plugins.github.git.GitJob > jobs = cloner.getJobs ( ) ; java.util.List < com.googlesrouce.gerrit.plugins.github.git.GitJobStatus > jobListStatus = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.googlesrouce.gerrit.plugins.github.git.GitJob job : jobs ) { jobListStatus.add ( job.getStatus ( ) ) ; } new com.google.gson.Gson ( ) . toJson ( jobListStatus , jobListStatus.getClass ( ) , new com.google.gson.stream.JsonWriter ( resp.getWriter ( ) ) ) ; }

Target:
protected void respondWithJobStatusJson ( javax.servlet.http.HttpServletResponse resp , com.googlesource.gerrit.plugins.github.git.BatchImporter cloner ) throws java.io.IOException { java.util.Collection < com.googlesource.gerrit.plugins.github.git.GitJob > jobs = cloner.getJobs ( ) ; java.util.List < com.googlesource.gerrit.plugins.github.git.GitJobStatus > jobListStatus = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.googlesource.gerrit.plugins.github.git.GitJob job : jobs ) { jobListStatus.add ( job.getStatus ( ) ) ; } new com.google.gson.Gson ( ) . toJson ( jobListStatus , jobListStatus.getClass ( ) , new com.google.gson.stream.JsonWriter ( resp.getWriter ( ) ) ) ; }
Source:
private static java.lang.String findId ( final java.util.Collection < com.google.gerrit.reviewdb.client.AccountExternalId > ids ) { for ( final com.google.gerrit.reviewdb.client.AccountExternalId i : ids ) { if ( i.isScheme ( AccountExternalId.SCHEME_GERRIT ) ) { return i.getSchemeRest ( ) ; } } return null ; }

Target:
public Account.Id lookup ( java.lang.String accountName ) { if ( com.google.common.base.Strings.isNullOrEmpty ( accountName ) ) { return null ; } try { com.google.common.base.Optional < com.google.gerrit.reviewdb.client.Account.Id > id = usernameCache.get ( accountName ) ; return id != null ? id.orNull ( ) : null ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.auth.ldap.LdapRealm.log.warn ( java.lang.String.format ( "Cannot lookup account %s in LDAP" , accountName ) , e ) ; return null ; } }
Source:
private int finish ( final java.util.Iterator < com.google.gerrit.client.reviewdb.PatchLineComment > i , int row , final int col ) { while ( i.hasNext ( ) ) { final com.google.gerrit.client.reviewdb.PatchLineComment c = i.next ( ) ; table.insertRow ( row ) ; table.getCellFormatter ( ) . setStyleName ( row , 0 , com.google.gerrit.client.patches.S_ICON_CELL ) ; bindComment ( row , col , c , ( ! ( i.hasNext ( ) ) ) ) ; row ++ ; } return row ; }

Target:
protected void insertRow ( final int row ) { super . insertRow ( row ) ; final com.google.gwt.user.client.ui.HTMLTable.CellFormatter fmt = table.getCellFormatter ( ) ; fmt.addStyleName ( row , ( ( com.google.gerrit.client.patches.SideBySideTable.COL_A ) - 1 ) , "LineNumber" ) ; fmt.addStyleName ( row , com.google.gerrit.client.patches.SideBySideTable.COL_A , "DiffText" ) ; fmt.addStyleName ( row , ( ( com.google.gerrit.client.patches.SideBySideTable.COL_B ) - 1 ) , "LineNumber" ) ; fmt.addStyleName ( row , com.google.gerrit.client.patches.SideBySideTable.COL_B , "DiffText" ) ; }
Source:
void onSyntaxHighlighting ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.syntaxHighlighting ( e.getValue ( ) ) ; if ( ( view ) != null ) { mode.setEnabled ( prefs.syntaxHighlighting ( ) ) ; if ( prefs.syntaxHighlighting ( ) ) { setMode ( view.getContentType ( ) ) ; } view.setSyntaxHighlighting ( prefs.syntaxHighlighting ( ) ) ; } }

Target:
void onAutoHideDiffTableHeader ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.autoHideDiffTableHeader ( ( ! ( e.getValue ( ) ) ) ) ; if ( ( view ) != null ) { view.setAutoHideDiffHeader ( ( ! ( e.getValue ( ) ) ) ) ; } }
Source:
public Project.NameKey getProject ( ) { return project ; }

Target:
public Project.NameKey project ( ) throws com.google.gwtorm.server.OrmException { if ( ( project ) == null ) { com.google.common.base.Preconditions.checkState ( ( ! ( notesMigration.readChanges ( ) ) ) , ( "should not have created " + " ChangeData without a project when notedb is enabled" ) ) ; project = change ( ) . getProject ( ) ; } return project ; }
Source:
private com.google.gerrit.reviewdb.client.ChangeMessage message ( final com.google.gerrit.reviewdb.client.Change c , final java.lang.String body ) { final java.lang.String uuid ; try { uuid = com.google.gerrit.server.ChangeUtil.messageUUID ( db ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return null ; } com.google.gerrit.reviewdb.client.ChangeMessage m = new com.google.gerrit.reviewdb.client.ChangeMessage ( new com.google.gerrit.reviewdb.client.ChangeMessage.Key ( c.getId ( ) , uuid ) , null , com.google.gerrit.server.util.TimeUtil.nowTs ( ) , c.currentPatchSetId ( ) ) ; m.setMessage ( body ) ; return m ; }

Target:
private com.google.gerrit.reviewdb.client.ChangeMessage message ( final com.google.gerrit.reviewdb.client.Change c , final java.lang.String body ) { final java.lang.String uuid ; try { uuid = com.google.gerrit.server.ChangeUtil.messageUUID ( db ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return null ; } com.google.gerrit.reviewdb.client.ChangeMessage m = new com.google.gerrit.reviewdb.client.ChangeMessage ( new com.google.gerrit.reviewdb.client.ChangeMessage.Key ( c.getId ( ) , uuid ) , null , com.google.gerrit.common.TimeUtil.nowTs ( ) , c.currentPatchSetId ( ) ) ; m.setMessage ( body ) ; return m ; }
Source:
public void setStatus ( java.lang.String status ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.account.PutStatus.Input in = new com.google.gerrit.server.account.PutStatus.Input ( status ) ; try { putStatus.apply ( account , in ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException | com.google.gerrit.server.permissions.PermissionBackendException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot set status" , e ) ; } }

Target:
public void setStatus ( java.lang.String status ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.account.PutStatus.Input in = new com.google.gerrit.server.account.PutStatus.Input ( status ) ; try { putStatus.apply ( account , in ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot set status" , e ) ; } }