auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void outgoingMailHasCustomReplyToHeader ( ) throws java.lang.Exception { createChangeWithReview ( user ) ; com.google.common.truth.Truth.assertThat ( sender.getMessages ( ) ) . hasSize ( 1 ) ; java.util.Map < java.lang.String , com.google.gerrit.server.mail.send.EmailHeader > headers = sender.getMessages ( ) . iterator ( ) . next ( ) . headers ( ) ; com.google.common.truth.Truth.assertThat ( headers.get ( "Reply-To" ) ) . isInstanceOf ( EmailHeader.String.class ) ; com.google.common.truth.Truth.assertThat ( ( ( com.google.gerrit.server.mail.send.EmailHeader.String ) ( headers.get ( "Reply-To" ) ) ) . getString ( ) ) . isEqualTo ( "custom@gerritcodereview.com" ) ; }

Target:
public void outgoingMailHasCustomReplyToHeader ( ) throws java.lang.Exception { createChangeWithReview ( user ) ; com.google.common.truth.Truth.assertThat ( sender.getMessages ( ) ) . hasSize ( 1 ) ; java.util.Map < java.lang.String , com.google.gerrit.server.mail.send.EmailHeader > headers = sender.getMessages ( ) . iterator ( ) . next ( ) . headers ( ) ; com.google.common.truth.Truth.assertThat ( headerString ( headers , "Reply-To" ) ) . isEqualTo ( "custom@gerritcodereview.com" ) ; }
Source:
private java.lang.String getContentType ( com.google.gerrit.client.diff.DiffInfo.FileMeta meta ) { if ( ( ( prefs.syntaxHighlighting ( ) ) && ( meta != null ) ) && ( ( meta.content_type ( ) ) != null ) ) { net.codemirror.mode.ModeInfo m = net.codemirror.mode.ModeInfo.findMode ( meta.content_type ( ) , path ) ; return m != null ? m.mime ( ) : null ; } return null ; }

Target:
private java.lang.String getContentType ( com.google.gerrit.client.diff.DiffInfo.FileMeta meta ) { if ( ( ( prefs.syntaxHighlighting ( ) ) && ( meta != null ) ) && ( ( meta.contentType ( ) ) != null ) ) { net.codemirror.mode.ModeInfo m = net.codemirror.mode.ModeInfo.findMode ( meta.contentType ( ) , path ) ; return m != null ? m.mime ( ) : null ; } return null ; }
Source:
public static java.util.Optional < java.util.TimeZone > getTimeZone ( org.eclipse.jgit.lib.Config config , java.lang.String section , java.lang.String subsection , java.lang.String name ) { java.lang.String id = config.getString ( section , subsection , name ) ; return id != null ? java.util.Optional.of ( java.util.TimeZone.getTimeZone ( id ) ) : java.util.Optional.empty ( ) ; }

Target:
public static java.util.Optional < java.util.TimeZone > getTimeZone ( org.eclipse.jgit.lib.Config config , java.lang.String section , java.lang.String subsection , java.lang.String name ) { return java.util.Optional.ofNullable ( config.getString ( section , subsection , name ) ) . map ( java.util.TimeZone :: getTimeZone ) ; }
Source:
public static synchronized void initialize ( final com.google.gerrit.reviewdb.server.ReviewDb db , final com.google.gerrit.server.account.AccountResolver resolver ) { if ( ( com.vmware.gerrit.owners.OwnersStoredValues.PATH_OWNERS ) != null ) { return ; } com.vmware.gerrit.owners.OwnersStoredValues.log.info ( "Initializing OwnerStoredValues" ) ; com.vmware.gerrit.owners.OwnersStoredValues.PATH_OWNERS = new com.google.gerrit.rules.StoredValue < com.vmware.gerrit.owners.common.PathOwners > ( ) { @ java.lang.Override protected com.vmware.gerrit.owners.common.PathOwners createValue ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.google.gerrit.server.patch.PatchList patchList = StoredValues.PATCH_LIST.get ( engine ) ; org.eclipse.jgit.lib.Repository repository = StoredValues.REPOSITORY.get ( engine ) ; return new com.vmware.gerrit.owners.common.PathOwners ( resolver , db , repository , patchList ) ; } } ; }

Target:
public static synchronized void initialize ( com.vmware.gerrit.owners.common.Accounts accounts ) { if ( ( com.vmware.gerrit.owners.OwnersStoredValues.PATH_OWNERS ) != null ) { return ; } com.vmware.gerrit.owners.OwnersStoredValues.log.info ( "Initializing OwnerStoredValues" ) ; com.vmware.gerrit.owners.OwnersStoredValues.PATH_OWNERS = new com.google.gerrit.rules.StoredValue < com.vmware.gerrit.owners.common.PathOwners > ( ) { @ java.lang.Override protected com.vmware.gerrit.owners.common.PathOwners createValue ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.google.gerrit.server.patch.PatchList patchList = StoredValues.PATCH_LIST.get ( engine ) ; org.eclipse.jgit.lib.Repository repository = StoredValues.REPOSITORY.get ( engine ) ; return new com.vmware.gerrit.owners.common.PathOwners ( accounts , repository , patchList ) ; } } ; }
Source:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException , java.io.IOException { validate ( ctx ) ; ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) , commit , getPatchSetId ( ) . toRefName ( ) , ReceiveCommand.Type.CREATE ) ) ; }

Target:
public void updateRepo ( com.google.gerrit.server.update.BatchUpdate.RepoContext ctx ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException , java.io.IOException { validate ( ctx ) ; ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) , commit , getPatchSetId ( ) . toRefName ( ) , ReceiveCommand.Type.CREATE ) ) ; }
Source:
private void assertNoIncludes ( java.lang.String group ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.AccountGroup g = groupCache.get ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( group ) ) ; java.util.Iterator < com.google.gerrit.reviewdb.client.AccountGroupById > it = db.accountGroupById ( ) . byGroup ( g.getId ( ) ) . iterator ( ) ; com.google.common.truth.Truth.assertThat ( it.hasNext ( ) ) . isFalse ( ) ; }

Target:
private void assertNoIncludes ( java.lang.String group ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( gApi.groups ( ) . id ( group ) . includedGroups ( ) . isEmpty ( ) ) ; }
Source:
public void onShowView ( ) { super . onShowView ( ) ; related.setMaxHeight ( commit.getElement ( ) . getParentElement ( ) . getOffsetHeight ( ) ) ; java.lang.String prior = com.google.gerrit.client.Gerrit.getPriorView ( ) ; if ( ( prior != null ) && ( prior.startsWith ( "/c/" ) ) ) { scrollToPath ( prior.substring ( 3 ) ) ; } startPoller ( ) ; }

Target:
public void onShowView ( ) { super . onShowView ( ) ; related.setMaxHeight ( commit.getElement ( ) . getParentElement ( ) . getOffsetHeight ( ) ) ; if ( openReplyBox ) { onReply ( ) ; } else { java.lang.String prior = com.google.gerrit.client.Gerrit.getPriorView ( ) ; if ( ( prior != null ) && ( prior.startsWith ( "/c/" ) ) ) { scrollToPath ( prior.substring ( 3 ) ) ; } } startPoller ( ) ; }
Source:
private java.util.Collection < com.google.gerrit.reviewdb.RefRight > filter ( java.util.Collection < com.google.gerrit.reviewdb.RefRight > all ) { java.util.List < com.google.gerrit.reviewdb.RefRight > mine = new java.util.ArrayList < com.google.gerrit.reviewdb.RefRight > ( all.size ( ) ) ; for ( com.google.gerrit.reviewdb.RefRight right : all ) { if ( com.google.gerrit.server.project.RefControl.matches ( getRefName ( ) , right.getRefPattern ( ) ) ) { mine.add ( right ) ; } } return mine ; }

Target:
private java.util.List < com.google.gerrit.reviewdb.RefRight > filter ( java.util.Collection < com.google.gerrit.reviewdb.RefRight > all , com.google.gerrit.reviewdb.ApprovalCategory.Id actionId ) { java.util.List < com.google.gerrit.reviewdb.RefRight > mine = new java.util.ArrayList < com.google.gerrit.reviewdb.RefRight > ( all.size ( ) ) ; for ( com.google.gerrit.reviewdb.RefRight right : all ) { if ( ( com.google.gerrit.server.project.RefControl.matches ( getRefName ( ) , right.getRefPattern ( ) ) ) && ( right.getApprovalCategoryId ( ) . equals ( actionId ) ) ) { mine.add ( right ) ; } } return mine ; }
Source:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.PrologException { engine.cont = cont ; engine.setB0 ( ) ; com.vmware.gerrit.owners.common.PathOwners owners = OwnersStoredValues.PATH_OWNERS.get ( engine ) ; engine.areg1 = arg1 ; engine.areg2 = arg2 ; engine.areg3 = new com.googlecode.prolog_cafe.lang.JavaObjectTerm ( owners.get ( ) . entries ( ) . iterator ( ) ) ; return engine.jtry3 ( gerrit_owners.PRED_owner_2.OWNER_CHECK , gerrit_owners.PRED_owner_2.OWNER_NEXT ) ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.exceptions.PrologException { engine.cont = cont ; engine.setB0 ( ) ; com.vmware.gerrit.owners.common.PathOwners owners = OwnersStoredValues.PATH_OWNERS.get ( engine ) ; engine.r1 = arg1 ; engine.r2 = arg2 ; engine.r3 = new com.googlecode.prolog_cafe.lang.JavaObjectTerm ( owners.get ( ) . entries ( ) . iterator ( ) ) ; return engine.jtry3 ( gerrit_owners.PRED_owner_2.OWNER_CHECK , gerrit_owners.PRED_owner_2.OWNER_NEXT ) ; }
Source:
javax.servlet.http.HttpServlet getGwtUiServlet ( @ com.google.inject.name.Named ( value = com.google.gerrit.httpd.raw.StaticModule.CACHE ) com.google.common.cache.Cache < java.nio.file.Path , com.google.gerrit.httpd.raw.ResourceServlet.Resource > cache ) throws java.io.IOException { com.google.gerrit.httpd.raw.StaticModule.Paths p = getPaths ( ) ; if ( ( p.warFs ) != null ) { return new com.google.gerrit.httpd.raw.WarGwtUiServlet ( cache , p.warFs ) ; } else { return new com.google.gerrit.httpd.raw.DeveloperGwtUiServlet ( cache , p.unpackedWar ) ; } }

Target:
javax.servlet.http.HttpServlet getGwtUiServlet ( @ com.google.inject.name.Named ( value = com.google.gerrit.httpd.raw.StaticModule.CACHE ) com.google.common.cache.Cache < java.nio.file.Path , com.google.gerrit.httpd.raw.ResourceServlet.Resource > cache ) throws java.io.IOException { com.google.gerrit.httpd.raw.StaticModule.Paths p = getPaths ( ) ; if ( ( p.warFs ) != null ) { return new com.google.gerrit.httpd.raw.WarGwtUiServlet ( cache , p.warFs ) ; } else { return new com.google.gerrit.httpd.raw.DirectoryGwtUiServlet ( cache , p.unpackedWar , p.isDev ( ) ) ; } }
Source:
private void blockRead ( com.google.gerrit.extensions.common.GroupInfo group ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.server.project.Util.block ( cfg , Permission.READ , new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( group.id ) , "refs/heads/master" ) ; saveProjectConfig ( project , cfg ) ; }

Target:
private void blockRead ( com.google.gerrit.extensions.common.GroupInfo group ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.server.project.testing.Util.block ( cfg , Permission.READ , new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( group.id ) , "refs/heads/master" ) ; saveProjectConfig ( project , cfg ) ; }
Source:
public void onCellClicked ( com.google.gwt.user.client.ui.SourcesTableEvents sender , int row , int cell ) { if ( cell == ( com.google.gerrit.client.changes.ChangeTable.C_STAR ) ) { onStarClick ( row ) ; } else if ( ( getRowItem ( row ) ) != null ) { movePointerTo ( row ) ; } }

Target:
public void onCellClicked ( com.google.gwt.user.client.ui.SourcesTableEvents sender , int row , int cell ) { if ( cell == ( com.google.gerrit.client.changes.ChangeTable.C_STAR ) ) { onStarClick ( row ) ; } else if ( ( cell == ( com.google.gerrit.client.changes.ChangeTable.C_OWNER ) ) || ( cell == ( com.google.gerrit.client.changes.ChangeTable.C_REVIEWERS ) ) ) { } else if ( ( getRowItem ( row ) ) != null ) { movePointerTo ( row ) ; } }
Source:
public java.util.List < com.googlesource.gerrit.plugins.xdocs.MenuEntry > getEntries ( ) { java.lang.StringBuilder url = new java.lang.StringBuilder ( ) ; url.append ( "/plugins/" ) ; url.append ( pluginName ) ; url.append ( XDocServlet.PATH_PREFIX ) ; url.append ( "${projectName}" ) ; return com.google.common.collect.Lists.newArrayList ( new com.googlesource.gerrit.plugins.xdocs.MenuEntry ( com.google.gerrit.extensions.webui.GerritTopMenu.PROJECTS , com.google.common.collect.Lists.newArrayList ( new com.googlesource.gerrit.plugins.xdocs.MenuItem ( "Readme" , url.toString ( ) ) ) ) ) ; }

Target:
public java.util.List < com.googlesource.gerrit.plugins.xdocs.MenuEntry > getEntries ( ) { java.lang.StringBuilder url = new java.lang.StringBuilder ( ) ; url.append ( "/plugins/" ) ; url.append ( pluginName ) ; url.append ( XDocServlet.PATH_PREFIX ) ; url.append ( "${projectName}" ) ; return com.google.common.collect.Lists.newArrayList ( new com.googlesource.gerrit.plugins.xdocs.MenuEntry ( com.google.gerrit.extensions.client.GerritTopMenu.PROJECTS , com.google.common.collect.Lists.newArrayList ( new com.googlesource.gerrit.plugins.xdocs.MenuItem ( "Readme" , url.toString ( ) ) ) ) ) ; }
Source:
public static org.eclipse.jgit.merge.ThreeWayMerger newThreeWayMerger ( org.eclipse.jgit.lib.Repository repo , final org.eclipse.jgit.lib.ObjectInserter inserter , java.lang.String strategyName ) { org.eclipse.jgit.merge.MergeStrategy strategy = org.eclipse.jgit.merge.MergeStrategy.get ( strategyName ) ; com.google.common.base.Preconditions.checkArgument ( ( strategy != null ) , "invalid merge strategy: %s" , strategyName ) ; org.eclipse.jgit.merge.Merger m = strategy.newMerger ( repo , true ) ; com.google.common.base.Preconditions.checkArgument ( ( m instanceof org.eclipse.jgit.merge.ThreeWayMerger ) , "merge strategy %s does not support three-way merging" , strategyName ) ; m.setObjectInserter ( inserter ) ; return ( ( org.eclipse.jgit.merge.ThreeWayMerger ) ( m ) ) ; }

Target:
public void flush ( ) { }
Source:
public java.lang.String get ( long num ) throws java.io.IOException { if ( ( ( getTail ( ) ) <= num ) && ( num <= ( getHead ( ) ) ) ) { try { return com.googlesource.gerrit.plugins.events.fsstore.Fs.readFile ( paths.events.path ( num ) ) ; } catch ( java.nio.file.NoSuchFileException e ) { } } return null ; }

Target:
public long getHead ( ) throws java.io.IOException { return cachedHead.spinGet ( com.googlesource.gerrit.plugins.events.fsstore.FsStore.MAX_GET_SPINS ) ; }
Source:
public void basicTextFormattingWorks ( ) throws java.io.IOException { java.lang.String raw = "*italic* **bold** `monospace`" ; java.lang.String formatted = ( ( com.googlesource.gerrit.plugins.xdocs.formatter.MarkdownFormatterTest.PROLOG ) + "<em>italic</em> <strong>bold</strong> <code>monospace</code>" ) + ( com.googlesource.gerrit.plugins.xdocs.formatter.MarkdownFormatterTest.EPILOG ) ; org.junit.Assert.assertEquals ( formatted , formatter.format ( null , null , null , null , cfg , raw ) ) ; }

Target:
public void emptyInputRendersNothing ( ) throws java.io.IOException { org.junit.Assert.assertEquals ( ( ( com.googlesource.gerrit.plugins.xdocs.formatter.MarkdownFormatterTest.PROLOG ) + ( com.googlesource.gerrit.plugins.xdocs.formatter.MarkdownFormatterTest.EPILOG ) ) , formatter.format ( null , null , null , null , cfg , StringUtils.EMPTY ) ) ; }
Source:
private void enableForm ( final boolean on ) { delRight.setEnabled ( on ) ; final boolean canAdd = on && ( ( catBox.getItemCount ( ) ) > 0 ) ; addRight.setEnabled ( canAdd ) ; nameTxtBox.setEnabled ( canAdd ) ; catBox.setEnabled ( canAdd ) ; rangeMinBox.setEnabled ( canAdd ) ; rangeMaxBox.setEnabled ( canAdd ) ; }

Target:
private void enableForm ( final boolean on ) { delRight.setEnabled ( on ) ; final boolean canAdd = on && ( ( catBox.getItemCount ( ) ) > 0 ) ; addRight.setEnabled ( canAdd ) ; nameTxtBox.setEnabled ( canAdd ) ; referenceTxt.setEnabled ( canAdd ) ; catBox.setEnabled ( canAdd ) ; rangeMinBox.setEnabled ( canAdd ) ; rangeMaxBox.setEnabled ( canAdd ) ; }
Source:
public void newPatchSetOnWipChangeSettingReadyInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%ready" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.owner ) . to ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; assertThat ( sender ) . notSent ( ) ; }

Target:
public void newPatchSetOnWipChangeNotifyAllInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; pushTo ( sc , "refs/for/master%wip,notify=ALL" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.reviewer , sc.ccer ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) . noOneElse ( ) ; }
Source:
private java.util.Set < java.lang.String > allRefPatterns ( com.google.gerrit.reviewdb.ApprovalCategory.Id actionId ) { final java.util.Set < java.lang.String > all = new java.util.HashSet < java.lang.String > ( ) ; for ( final com.google.gerrit.reviewdb.RefRight pr : state.getAllRights ( actionId , true ) ) { all.add ( pr.getRefPattern ( ) ) ; } return all ; }

Target:
java.util.Collection < com.google.gerrit.common.data.AccessSection > access ( ) { if ( ( access ) == null ) { access = state.getAllAccessSections ( ) ; } return access ; }
Source:
public com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DownloadScheme getDownloadUrl ( ) { if ( ( downloadUrl ) == null ) { return null ; } return com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DownloadScheme.valueOf ( downloadUrl ) ; }

Target:
public void setDownloadUrl ( java.lang.String url ) { if ( ( downloadUrl ) != null ) { switch ( url ) { case CoreDownloadSchemes.ANON_GIT : url = "ANON_GIT" ; break ; case CoreDownloadSchemes.ANON_HTTP : url = "ANON_HTTP" ; break ; case CoreDownloadSchemes.HTTP : url = "HTTP" ; break ; case CoreDownloadSchemes.SSH : url = "SSH" ; break ; case CoreDownloadSchemes.REPO_DOWNLOAD : url = "REPO_DOWNLOAD" ; break ; } } downloadUrl = url ; }
Source:
private void writeToResponse ( javax.servlet.http.HttpServletResponse res , java.io.InputStream in ) throws java.io.IOException { try { java.io.OutputStream out = res.getOutputStream ( ) ; try { byte [ ] tmp = new byte [ 1024 ] ; int n ; while ( ( n = in.read ( tmp ) ) > 0 ) { out.write ( tmp , 0 , n ) ; } } finally { out.close ( ) ; } } finally { in.close ( ) ; } }

Target:
private void writeToResponse ( javax.servlet.http.HttpServletResponse res , java.io.InputStream inputStream ) throws java.io.IOException { try ( java.io.OutputStream out = res.getOutputStream ( ) ; java.io.InputStream in = inputStream ) { com.google.common.io.ByteStreams.copy ( in , out ) ; } }
Source:
protected void doDelete ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) { try { setUnhealthy ( ) ; rsp.setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.health.HealthServlet.log.error ( "Failed to set unhealthy" , e ) ; sendError ( rsp , javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR ) ; } }

Target:
protected void doPost ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) { if ( ! ( currentUserProvider.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) { sendError ( rsp , javax.servlet.http.HttpServletResponse.SC_FORBIDDEN ) ; return ; } this . healthy = true ; rsp.setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; }
Source:
private void formatHtmlDiff ( java.io.OutputStream out , com.google.gitiles.GitilesView view , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.treewalk.AbstractTreeIterator oldTree , org.eclipse.jgit.treewalk.AbstractTreeIterator newTree , java.lang.String path ) throws java.io.IOException { org.eclipse.jgit.diff.DiffFormatter diff = new com.google.gitiles.HtmlDiffFormatter ( renderer , view , out ) ; try { if ( ! ( path.equals ( "" ) ) ) { diff.setPathFilter ( org.eclipse.jgit.treewalk.filter.PathFilter.create ( path ) ) ; } diff.setRepository ( repo ) ; diff.setDetectRenames ( true ) ; diff.format ( oldTree , newTree ) ; } finally { diff.release ( ) ; } }

Target:
private static void formatDiff ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.treewalk.AbstractTreeIterator oldTree , org.eclipse.jgit.treewalk.AbstractTreeIterator newTree , java.lang.String path , org.eclipse.jgit.diff.DiffFormatter diff ) throws java.io.IOException { try { if ( ! ( path.equals ( "" ) ) ) { diff.setPathFilter ( org.eclipse.jgit.treewalk.filter.PathFilter.create ( path ) ) ; } diff.setRepository ( repo ) ; diff.setDetectRenames ( true ) ; diff.format ( oldTree , newTree ) ; } finally { diff.release ( ) ; } }
Source:
private void appendFileLine ( java.lang.StringBuilder cmts , com.google.gerrit.server.patch.PatchFile fileData , short side , int line ) { cmts.append ( ( "Line " + line ) ) ; try { final java.lang.String lineStr = fileData.getLine ( side , line ) ; cmts.append ( ": " ) ; cmts.append ( lineStr ) ; } catch ( java.lang.Throwable e ) { cmts.append ( "" ) ; } cmts.append ( "\n" ) ; }

Target:
private java.lang.String getCommentLinePrefix ( com.google.gerrit.reviewdb.client.Comment comment ) { int lineNbr = ( ( comment.range ) == null ) ? comment.lineNbr : comment.range.startLine ; return ( ( ( "PS" + ( comment.key.patchSetId ) ) + ", Line " ) + lineNbr ) + ": " ; }
Source:
private void loadMyEmails ( ) throws com.google.gerrit.server.ssh.commands.Failure { addEmail ( currentUser.getAccount ( ) . getPreferredEmail ( ) ) ; try { for ( final com.google.gerrit.client.reviewdb.AccountExternalId id : db.accountExternalIds ( ) . byAccount ( currentUser.getAccountId ( ) ) ) { addEmail ( id.getEmailAddress ( ) ) ; } } catch ( com.google.gwtorm.client.OrmException e ) { throw new com.google.gerrit.server.ssh.commands.Failure ( 1 , "fatal: database error" , e ) ; } }

Target:
private Account.Id toAccountId ( final java.lang.String nameOrEmail ) throws com.google.gwtorm.client.OrmException , javax.security.auth.login.AccountNotFoundException { final com.google.gerrit.client.reviewdb.Account a = accountResolver.find ( nameOrEmail ) ; if ( a == null ) { throw new javax.security.auth.login.AccountNotFoundException ( ( ( "\"" + nameOrEmail ) + "\" is not registered" ) ) ; } return a.getId ( ) ; }
Source:
void onSave ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { save.setEnabled ( false ) ; com.google.gerrit.client.changes.ChangeFileApi.putMessage ( changeId , message.getText ( ) . trim ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChangeInEditMode ( changeId ) ) ; hide ( ) ; } } ) ; }

Target:
void onSave ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { save.setEnabled ( false ) ; com.google.gerrit.client.changes.ChangeEditApi.putMessage ( changeId.get ( ) , message.getText ( ) . trim ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChangeInEditMode ( changeId ) ) ; hide ( ) ; } } ) ; }
Source:
private void update ( ) { if ( ( ( currentCommand ) != null ) && ( ( currentUrl ) != null ) ) { currentCommand.setCurrentUrl ( currentUrl ) ; } }

Target:
private void update ( ) { if ( ( ( currentCommand ) != null ) && ( ( currentUrl ) != null ) ) { currentCommand.setCurrentUrl ( currentUrl ) ; } else if ( ( ( currentCommand ) != null ) && ( currentCommand.getCmdType ( ) . equals ( DownloadCommand.REPO_DOWNLOAD ) ) ) { currentCommand.setCurrentUrl ( null ) ; } }
Source:
private void initMacs ( final org.eclipse.jgit.lib.Config cfg ) { setMacFactories ( com.google.gerrit.sshd.SshDaemon.filter ( cfg , "mac" , new org.apache.sshd.common.mac.HMACMD5.Factory ( ) , new org.apache.sshd.common.mac.HMACSHA1.Factory ( ) , new org.apache.sshd.common.mac.HMACMD596.Factory ( ) , new org.apache.sshd.common.mac.HMACSHA196.Factory ( ) , new org.apache.sshd.common.mac.HMACSHA256.Factory ( ) , new org.apache.sshd.common.mac.HMACSHA512.Factory ( ) ) ) ; }

Target:
private void initMacs ( org.eclipse.jgit.lib.Config cfg ) { java.util.List < org.apache.sshd.common.NamedFactory < org.apache.sshd.common.mac.Mac > > m = org.apache.sshd.common.BaseBuilder.setUpDefaultMacs ( true ) ; setMacFactories ( com.google.gerrit.sshd.SshDaemon.filter ( cfg , "mac" , ( ( org.apache.sshd.common.NamedFactory < org.apache.sshd.common.mac.Mac > [ ] ) ( m.toArray ( new org.apache.sshd.common.NamedFactory [ m.size ( ) ] ) ) ) ) ) ; }
Source:
private void readObject ( final java.io.ObjectInputStream in ) throws java.io.IOException { oldId = org.eclipse.jgit.lib.ObjectIdSerialization.readCanBeNull ( in ) ; newId = org.eclipse.jgit.lib.ObjectIdSerialization.readNotNull ( in ) ; whitespace = com.google.gerrit.server.ioutil.BasicSerialization.readEnum ( in , com.google.gerrit.reviewdb.AccountDiffPreference.Whitespace.values ( ) ) ; }

Target:
private void readObject ( final java.io.ObjectInputStream in ) throws java.io.IOException { oldId = org.eclipse.jgit.lib.ObjectIdSerialization.readCanBeNull ( in ) ; newId = org.eclipse.jgit.lib.ObjectIdSerialization.readNotNull ( in ) ; oldIdName = ( ( oldId ) != null ) ? oldId.name ( ) : null ; newIdName = newId.name ( ) ; whitespace = com.google.gerrit.server.ioutil.BasicSerialization.readEnum ( in , com.google.gerrit.reviewdb.AccountDiffPreference.Whitespace.values ( ) ) ; whitespaceCode = whitespace.getCode ( ) ; }
Source:
private void init ( java.lang.String project , java.lang.String branch , com.googlesource.gerrit.plugins.repositoryuse.RefUpdateHandlerFactory refUpdateHandlerFactory , com.google.gerrit.server.project.ProjectControl.GenericFactory p , com.google.gerrit.server.CurrentUser user , com.google.gerrit.server.git.GitRepositoryManager repoManager ) { this . project = project ; this . branch = branch ; this . refUpdateHandlerFactory = refUpdateHandlerFactory ; this . projectControl = p ; this . user = user ; this . repoManager = repoManager ; }

Target:
private void init ( java.lang.String project , java.lang.String branch , com.googlesource.gerrit.plugins.repositoryuse.RefUpdateHandlerFactory refUpdateHandlerFactory , com.google.gerrit.extensions.api.projects.Projects projects ) { this . project = project ; this . branch = branch ; this . refUpdateHandlerFactory = refUpdateHandlerFactory ; this . projects = projects ; }
Source:
private java.lang.Object logo ( ) { if ( ( logoUrl ) == null ) { return null ; } java.lang.String url = fmt.image ( logoUrl ) ; if ( com.google.gitiles.doc.html.HtmlBuilder.isValidHttpUri ( url ) ) { return url ; } else if ( com.google.gitiles.doc.html.HtmlBuilder.isImageDataUri ( url ) ) { return com.google.template.soy.shared.restricted.Sanitizers.filterImageDataUri ( url ) ; } else { return FilterImageDataUri.INSTANCE.getInnocuousOutput ( ) ; } }

Target:
private java.lang.Object logo ( ) { if ( ( logoUrl ) == null ) { return null ; } java.lang.String url = fmt.image ( logoUrl ) ; if ( com.google.gitiles.doc.html.HtmlBuilder.isValidHttpUri ( url ) ) { return url ; } else if ( com.google.gitiles.doc.html.HtmlBuilder.isImageDataUri ( url ) ) { return com.google.template.soy.shared.internal.Sanitizers.filterImageDataUri ( url ) ; } else { return SoyConstants.IMAGE_URI_INNOCUOUS_OUTPUT ; } }
Source:
public void testDoPostDispatcherFailure ( ) throws java.lang.Exception { java.lang.String event = "{\"project\":\"gerrit/test-sync-index\",\"ref\":" + ( "\"refs/changes/76/669676/2\",\"nodesCount\":1,\"type\":" + "\"ref-replication-done\",\"eventCreatedOn\":1451415011}" ) ; org.mockito.Mockito.when ( req.getReader ( ) ) . thenReturn ( new java.io.BufferedReader ( new java.io.StringReader ( event ) ) ) ; org.mockito.Mockito.doThrow ( new com.google.gwtorm.server.OrmException ( com.ericsson.gerrit.plugins.syncevents.SyncEventsRestApiServletTest.ERR_MSG ) ) . when ( dispatcher ) . postEvent ( org.mockito.ArgumentMatchers.any ( com.ericsson.gerrit.plugins.syncevents.SyncEventsRestApiServletTest.RefReplicationDoneEvent.class ) ) ; syncEventsRestApiServlet.doPost ( req , rsp ) ; org.mockito.Mockito.verify ( rsp ) . sendError ( javax.servlet.http.HttpServletResponse.SC_NOT_FOUND , "Change not found\n" ) ; }

Target:
public void testDoPostDispatcherFailure ( ) throws java.lang.Exception { java.lang.String event = "{\"project\":\"gerrit/some-project\",\"ref\":" + ( "\"refs/changes/76/669676/2\",\"nodesCount\":1,\"type\":" + "\"ref-replication-done\",\"eventCreatedOn\":1451415011}" ) ; org.mockito.Mockito.when ( req.getReader ( ) ) . thenReturn ( new java.io.BufferedReader ( new java.io.StringReader ( event ) ) ) ; org.mockito.Mockito.doThrow ( new com.google.gwtorm.server.OrmException ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.EventRestApiServletTest.ERR_MSG ) ) . when ( dispatcher ) . postEvent ( org.mockito.ArgumentMatchers.any ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.EventRestApiServletTest.RefReplicationDoneEvent.class ) ) ; eventRestApiServlet.doPost ( req , rsp ) ; org.mockito.Mockito.verify ( rsp ) . sendError ( javax.servlet.http.HttpServletResponse.SC_NOT_FOUND , "Change not found\n" ) ; }
Source:
protected void configureServlets ( ) { serveRegex ( com.google.gerrit.httpd.plugins.LfsPluginServlet.URL_REGEX ) . with ( com.googlesource.gerrit.plugins.lfs.LfsApiServlet.class ) ; populateRepository ( defaultBackend ) ; for ( com.googlesource.gerrit.plugins.lfs.LfsBackend backend : backends.values ( ) ) { populateRepository ( backend ) ; } com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.webui.WebUiPlugin.class ) . toInstance ( new com.google.gerrit.extensions.webui.JavaScriptPlugin ( "lfs-project-info.js" ) ) ; }

Target:
protected void configureServlets ( ) { serveRegex ( com.googlesource.gerrit.plugins.lfs.LfsApiServlet.LFS_OBJECTS_REGEX_REST ) . with ( com.googlesource.gerrit.plugins.lfs.LfsApiServlet.class ) ; serveRegex ( com.googlesource.gerrit.plugins.lfs.locks.LfsLocksServlet.LFS_LOCKS_REGEX_REST ) . with ( com.googlesource.gerrit.plugins.lfs.locks.LfsLocksServlet.class ) ; populateRepository ( defaultBackend ) ; for ( com.googlesource.gerrit.plugins.lfs.LfsBackend backend : backends.values ( ) ) { populateRepository ( backend ) ; } com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.webui.WebUiPlugin.class ) . toInstance ( new com.google.gerrit.extensions.webui.JavaScriptPlugin ( "lfs-project-info.js" ) ) ; }
Source:
public PatchSet.Id call ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException { try { if ( ( ( magicBranch ) != null ) && ( magicBranch.edit ) ) { return upsertEdit ( ) ; } else if ( caller == ( java.lang.Thread.currentThread ( ) ) ) { return insertPatchSet ( db ) ; } else { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schemaFactory.open ( ) ) { return insertPatchSet ( db ) ; } } } finally { com.google.gerrit.server.git.ReceiveCommits.synchronizedIncrement ( replaceProgress ) ; } }

Target:
public PatchSet.Id call ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException { try { if ( ( ( magicBranch ) != null ) && ( magicBranch.edit ) ) { return upsertEdit ( ) ; } try ( com.google.gerrit.server.git.ReceiveCommits.RequestState state = requestState ( caller ) ) { return insertPatchSet ( state ) ; } } finally { com.google.gerrit.server.git.ReceiveCommits.synchronizedIncrement ( replaceProgress ) ; } }
Source:
public org.spearce.jgit.lib.PersonIdent newGerritPersonIdent ( ) { java.lang.String name = getGerritConfig ( ) . getString ( "user" , null , "name" ) ; if ( name == null ) { name = "Gerrit Code Review" ; } java.lang.String email = getGerritConfig ( ) . getCommitterEmail ( ) ; if ( ( email == null ) || ( ( email.length ( ) ) == 0 ) ) { email = "gerrit@localhost" ; } return new org.spearce.jgit.lib.PersonIdent ( name , email ) ; }

Target:
public org.spearce.jgit.lib.PersonIdent newGerritPersonIdent ( ) { java.lang.String name = getGerritConfig ( ) . getString ( "user" , null , "name" ) ; if ( name == null ) { name = "Gerrit Code Review" ; } java.lang.String email = getGerritConfig ( ) . get ( UserConfig.KEY ) . getCommitterEmail ( ) ; if ( ( email == null ) || ( ( email.length ( ) ) == 0 ) ) { email = "gerrit@localhost" ; } return new org.spearce.jgit.lib.PersonIdent ( name , email ) ; }
Source:
private void upsertDraftComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { createDraftUpdateIfNull ( ) ; draftUpdate.upsertComment ( c ) ; }

Target:
public void putComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { verifyComment ( c ) ; createDraftUpdateIfNull ( ) ; if ( ( c.getStatus ( ) ) == ( PatchLineComment.Status.DRAFT ) ) { draftUpdate.putComment ( c ) ; } else { comments.add ( c ) ; draftUpdate.deleteComment ( c ) ; } }
Source:
public com.google.gerrit.server.project.ProjectJson.ProjectInfo apply ( com.google.gerrit.server.project.ChildProjectResource rsrc ) { return json.format ( rsrc.getChild ( ) . getProject ( ) ) ; }

Target:
public com.google.gerrit.server.project.ProjectJson.ProjectInfo apply ( com.google.gerrit.server.project.ChildProjectResource rsrc ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { if ( ( recursive ) || ( rsrc.isDirectChild ( ) ) ) { return json.format ( rsrc.getChild ( ) . getProject ( ) ) ; } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( rsrc.getName ( ) ) ; }
Source:
public java.util.List < com.google.gerrit.reviewdb.client.Change > load ( com.google.gerrit.reviewdb.client.Project.NameKey key ) throws java.lang.Exception { try ( java.lang.AutoCloseable ctx = requestContext.open ( ) ) { return java.util.Collections.unmodifiableList ( com.google.gerrit.server.query.change.ChangeData.asChanges ( queryProvider.get ( ) . byProject ( key ) ) ) ; } }

Target:
public java.util.List < com.google.gerrit.server.git.SearchingChangeCacheImpl.CachedChange > load ( com.google.gerrit.reviewdb.client.Project.NameKey key ) throws java.lang.Exception { try ( java.lang.AutoCloseable ctx = requestContext.open ( ) ) { java.util.List < com.google.gerrit.server.query.change.ChangeData > cds = queryProvider.get ( ) . byProject ( key ) ; java.util.List < com.google.gerrit.server.git.SearchingChangeCacheImpl.CachedChange > result = new java.util.ArrayList ( cds.size ( ) ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : cds ) { result.add ( new com.google.gerrit.server.git.AutoValue_SearchingChangeCacheImpl_CachedChange ( cd.change ( ) , cd.getReviewers ( ) ) ) ; } return java.util.Collections.unmodifiableList ( result ) ; } }
Source:
public void add ( final com.google.gerrit.server.plugins.RegistrationHandle handle ) { add ( new com.google.gerrit.lifecycle.LifecycleListener ( ) { @ java.lang.Override public void start ( ) { } @ java.lang.Override public void stop ( ) { handle.remove ( ) ; } } ) ; }

Target:
public void add ( final com.google.gerrit.extensions.registration.RegistrationHandle handle ) { if ( handle instanceof com.google.gerrit.extensions.registration.ReloadableRegistrationHandle ) { if ( ( reloadableHandles ) == null ) { reloadableHandles = com.google.common.collect.Lists.newArrayList ( ) ; } reloadableHandles.add ( ( ( com.google.gerrit.extensions.registration.ReloadableRegistrationHandle < ? > ) ( handle ) ) ) ; } add ( new com.google.gerrit.lifecycle.LifecycleListener ( ) { @ java.lang.Override public void start ( ) { } @ java.lang.Override public void stop ( ) { handle.remove ( ) ; } } ) ; }
Source:
protected void configure ( ) { com.google.gerrit.sshd.CommandName gerrit = com.google.gerrit.sshd.Commands.named ( "gerrit" ) ; com.google.gerrit.sshd.CommandName index = com.google.gerrit.sshd.Commands.named ( gerrit , "index" ) ; command ( index ) . toProvider ( new com.google.gerrit.sshd.DispatchCommandProvider ( index ) ) ; if ( ( injector.getExistingBinding ( com.google.inject.Key.get ( com.google.gerrit.server.index.AbstractVersionManager.class ) ) ) != null ) { command ( index , com.google.gerrit.sshd.commands.IndexActivateCommand.class ) ; command ( index , com.google.gerrit.sshd.commands.IndexStartCommand.class ) ; } command ( index , com.google.gerrit.sshd.commands.IndexChangesCommand.class ) ; command ( index , com.google.gerrit.sshd.commands.IndexProjectCommand.class ) ; }

Target:
protected void configure ( ) { com.google.gerrit.sshd.CommandName gerrit = com.google.gerrit.sshd.Commands.named ( "gerrit" ) ; com.google.gerrit.sshd.CommandName index = com.google.gerrit.sshd.Commands.named ( gerrit , "index" ) ; command ( index ) . toProvider ( new com.google.gerrit.sshd.DispatchCommandProvider ( index ) ) ; if ( ( injector.getExistingBinding ( com.google.inject.Key.get ( com.google.gerrit.server.index.VersionManager.class ) ) ) != null ) { command ( index , com.google.gerrit.sshd.commands.IndexActivateCommand.class ) ; command ( index , com.google.gerrit.sshd.commands.IndexStartCommand.class ) ; } command ( index , com.google.gerrit.sshd.commands.IndexChangesCommand.class ) ; command ( index , com.google.gerrit.sshd.commands.IndexProjectCommand.class ) ; }
Source:
protected com.google.gerrit.extensions.common.RobotCommentInfo toInfo ( com.google.gerrit.reviewdb.client.RobotComment c , com.google.gerrit.server.account.AccountLoader loader ) { com.google.gerrit.extensions.common.RobotCommentInfo rci = new com.google.gerrit.extensions.common.RobotCommentInfo ( ) ; rci.robotId = c.robotId ; rci.robotRunId = c.robotRunId ; rci.url = c.url ; rci.properties = c.properties ; fillCommentInfo ( c , rci , loader ) ; return rci ; }

Target:
protected com.google.gerrit.extensions.common.RobotCommentInfo toInfo ( com.google.gerrit.reviewdb.client.RobotComment c , com.google.gerrit.server.account.AccountLoader loader ) { com.google.gerrit.extensions.common.RobotCommentInfo rci = new com.google.gerrit.extensions.common.RobotCommentInfo ( ) ; rci.robotId = c.robotId ; rci.robotRunId = c.robotRunId ; rci.url = c.url ; rci.properties = c.properties ; rci.fixSuggestions = toFixSuggestionInfos ( c.fixSuggestions ) ; fillCommentInfo ( c , rci , loader ) ; return rci ; }
Source:
public com.google.gerrit.extensions.client.EditPreferencesInfo apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { permissionBackend.user ( self ) . check ( GlobalPermission.MODIFY_ACCOUNT ) ; } com.google.gerrit.reviewdb.client.Account.Id id = rsrc.getUser ( ) . getAccountId ( ) ; return accountCache.maybeGet ( id ) . map ( AccountState :: getEditPreferences ) . orElseThrow ( ResourceNotFoundException :: new ) ; }

Target:
public com.google.gerrit.extensions.client.EditPreferencesInfo apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { permissionBackend.user ( self ) . check ( GlobalPermission.MODIFY_ACCOUNT ) ; } com.google.gerrit.reviewdb.client.Account.Id id = rsrc.getUser ( ) . getAccountId ( ) ; return accountCache.get ( id ) . map ( AccountState :: getEditPreferences ) . orElseThrow ( ( ) -> new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( com.google.gerrit.extensions.restapi.IdString.fromDecoded ( id.toString ( ) ) ) ) ; }
Source:
public void registerKeys ( ) { super . registerKeys ( ) ; contentTable.setRegisterKeys ( contentTable.isVisible ( ) ) ; if ( ( regNavigation ) != null ) { regNavigation.removeHandler ( ) ; regNavigation = null ; } regNavigation = com.google.gwtexpui.globalkey.client.GlobalKey.add ( this , keysNavigation ) ; }

Target:
public void registerKeys ( ) { super . registerKeys ( ) ; contentTable.setRegisterKeys ( contentTable.isVisible ( ) ) ; if ( ( regNavigation ) != null ) { regNavigation.removeHandler ( ) ; regNavigation = null ; } regNavigation = com.google.gwtexpui.globalkey.client.GlobalKey.add ( this , keysNavigation ) ; if ( ( regAction ) != null ) { regAction.removeHandler ( ) ; regAction = null ; } if ( ( keysAction ) != null ) { regAction = com.google.gwtexpui.globalkey.client.GlobalKey.add ( this , keysAction ) ; } }
Source:
public static void suggest ( java.lang.String prefix , int limit , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.projects.ProjectMap > cb ) { new com.google.gerrit.client.rpc.RestApi ( "/projects/" ) . addParameter ( "p" , prefix ) . addParameter ( "n" , limit ) . addParameterRaw ( "type" , "ALL" ) . addParameterTrue ( "d" ) . get ( com.google.gerrit.client.rpc.NativeMap.copyKeysIntoChildren ( cb ) ) ; }

Target:
public static void suggest ( java.lang.String prefix , int limit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.projects.ProjectMap > cb ) { new com.google.gerrit.client.rpc.RestApi ( "/projects/" ) . addParameter ( "p" , prefix ) . addParameter ( "n" , limit ) . addParameterRaw ( "type" , "ALL" ) . addParameterTrue ( "d" ) . get ( com.google.gerrit.client.rpc.NativeMap.copyKeysIntoChildren ( cb ) ) ; }
Source:
public org.eclipse.jgit.revwalk.RevCommit commit ( ) throws java.io.IOException { com.google.gerrit.server.notedb.BatchMetaDataUpdate batch = openUpdate ( ) ; try { writeCommit ( batch ) ; org.eclipse.jgit.revwalk.RevCommit c = batch.commit ( ) ; return c ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.io.IOException ( e ) ; } finally { batch.close ( ) ; } }

Target:
public org.eclipse.jgit.lib.ObjectId commit ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.notedb.NoteDbUpdateManager updateManager = updateManagerFactory.create ( getProjectName ( ) ) ; updateManager.add ( this ) ; updateManager.execute ( ) ; return getResult ( ) ; }
Source:
private void buildCommentTable ( com.google.common.collect.Table < com.google.gerrit.reviewdb.client.PatchSet.Id , java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > commentTable , com.google.common.collect.Multimap < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchLineComment > allComments ) { for ( com.google.gerrit.reviewdb.client.PatchLineComment c : allComments.values ( ) ) { commentTable.put ( com.google.gerrit.server.notedb.CommentsInNotesUtil.getCommentPsId ( c ) , c.getKey ( ) . get ( ) , c ) ; } }

Target:
protected void loadDefaults ( ) { comments = com.google.common.collect.ImmutableListMultimap.of ( ) ; }
Source:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo publisher , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.DraftPublished.Event event = new com.google.gerrit.server.extensions.events.DraftPublished.Event ( change , revision , publisher , when ) ; for ( com.google.gerrit.extensions.events.DraftPublishedListener l : listeners ) { try { l.onDraftPublished ( event ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.extensions.events.DraftPublished.log.warn ( "Error in event listener" , e ) ; } } }

Target:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo publisher , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.DraftPublished.Event event = new com.google.gerrit.server.extensions.events.DraftPublished.Event ( change , revision , publisher , when ) ; for ( com.google.gerrit.extensions.events.DraftPublishedListener l : listeners ) { try { l.onDraftPublished ( event ) ; } catch ( java.lang.Exception e ) { util.logEventListenerError ( com.google.gerrit.server.extensions.events.DraftPublished.log , e ) ; } } }
Source:
protected void service ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse resp ) throws java.io.IOException { try { final com.google.gwtjsonrpc.server.ActiveCall c = createActiveCall ( req , resp ) ; com.google.gwtjsonrpc.server.JsonServlet.perThreadCall.set ( c ) ; doService ( c ) ; } finally { com.google.gwtjsonrpc.server.JsonServlet.perThreadCall.set ( null ) ; } }

Target:
protected void service ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse resp ) throws java.io.IOException { try { final CallType c = createActiveCall ( req , resp ) ; com.google.gwtjsonrpc.server.JsonServlet.perThreadCall.set ( c ) ; doService ( c ) ; } finally { com.google.gwtjsonrpc.server.JsonServlet.perThreadCall.set ( null ) ; } }
Source:
private void alias ( final java.lang.String from , final java.lang.String to ) { commands.put ( to , commands.get ( from ) ) ; }

Target:
private com.google.gerrit.server.ssh.AbstractCommand create ( final java.lang.String cmd ) { final com.google.inject.Provider < ? extends com.google.gerrit.server.ssh.AbstractCommand > f = commands.get ( cmd ) ; if ( f != null ) { return f.get ( ) ; } return new com.google.gerrit.server.ssh.AbstractCommand ( ) { @ java.lang.Override protected void run ( ) throws com.google.gerrit.server.ssh.Failure { throw new com.google.gerrit.server.ssh.UnloggedFailure ( 127 , ( ( "gerrit: " + ( getName ( ) ) ) + ": not found" ) ) ; } } ; }
Source:
public void createEmptyEditRest ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( adminSession.post ( urlEdit ( ) ) . getStatusCode ( ) ) . isEqualTo ( org.apache.http.HttpStatus.SC_NO_CONTENT ) ; com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( change ) ; com.google.gerrit.acceptance.edit.ChangeEditIT.assertByteArray ( fileUtil.getContent ( edit.get ( ) . getChange ( ) . getProject ( ) , edit.get ( ) . getRevision ( ) . get ( ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME ) , com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_OLD ) ; }

Target:
public void createEmptyEditRest ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( adminSession.post ( urlEdit ( ) ) . getStatusCode ( ) ) . isEqualTo ( org.apache.http.HttpStatus.SC_NO_CONTENT ) ; com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( change ) ; com.google.gerrit.acceptance.edit.ChangeEditIT.assertByteArray ( fileUtil.getContent ( projectCache.get ( edit.get ( ) . getChange ( ) . getProject ( ) ) , org.eclipse.jgit.lib.ObjectId.fromString ( edit.get ( ) . getRevision ( ) . get ( ) ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME ) , com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_OLD ) ; }