auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > suggestReviewers ( com.google.gerrit.server.api.changes.SuggestedReviewersRequest r ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.SuggestReviewers mySuggestReviewers = suggestReviewers.get ( ) ; mySuggestReviewers.setQuery ( r.getQuery ( ) ) ; mySuggestReviewers.setLimit ( r.getLimit ( ) ) ; return mySuggestReviewers.apply ( change ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve suggested reviewers" , e ) ; } }

Target:
public void publish ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { publishDraftChange.apply ( change , null ) ; } catch ( com.google.gerrit.server.git.UpdateException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot publish change" , e ) ; } }
Source:
public void run ( ) { try ( java.io.BufferedReader br = new java.io.BufferedReader ( new java.io.InputStreamReader ( in , "ISO-8859-1" ) ) ) { java.lang.String line ; while ( ( line = br.readLine ( ) ) != null ) { com.google.gerrit.httpd.gitweb.GitwebServlet.log.error ( ( "CGI: " + line ) ) ; } } catch ( java.io.IOException e ) { com.google.gerrit.httpd.gitweb.GitwebServlet.log.debug ( "Unexpected error copying stderr from CGI" , e ) ; } }

Target:
public void run ( ) { try ( java.io.BufferedReader br = new java.io.BufferedReader ( new java.io.InputStreamReader ( in , java.nio.charset.StandardCharsets.ISO_8859_1.name ( ) ) ) ) { java.lang.String line ; while ( ( line = br.readLine ( ) ) != null ) { com.google.gerrit.httpd.gitweb.GitwebServlet.log.error ( ( "CGI: " + line ) ) ; } } catch ( java.io.IOException e ) { com.google.gerrit.httpd.gitweb.GitwebServlet.log.debug ( "Unexpected error copying stderr from CGI" , e ) ; } }
Source:
private static void setXsrfTokenCookie ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp , com.google.gerrit.httpd.WebSession session ) { java.lang.String v = ( session != null ) ? session.getXGerritAuth ( ) : "" ; javax.servlet.http.Cookie c = new javax.servlet.http.Cookie ( com.google.gerrit.common.data.HostPageData.XSRF_COOKIE_NAME , v ) ; c.setPath ( "/" ) ; c.setSecure ( com.google.gerrit.httpd.XsrfCookieFilter.isSecure ( req ) ) ; c.setMaxAge ( ( session != null ? - 1 : 0 ) ) ; rsp.addCookie ( c ) ; }

Target:
private void setXsrfTokenCookie ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp , com.google.gerrit.httpd.WebSession session ) { java.lang.String v = ( session != null ) ? session.getXGerritAuth ( ) : "" ; javax.servlet.http.Cookie c = new javax.servlet.http.Cookie ( com.google.gerrit.common.data.HostPageData.XSRF_COOKIE_NAME , v ) ; c.setPath ( "/" ) ; c.setSecure ( ( ( authConfig.getCookieSecure ( ) ) && ( isSecure ( req ) ) ) ) ; c.setMaxAge ( ( session != null ? - 1 : 0 ) ) ; rsp.addCookie ( c ) ; }
Source:
public void unwrapDb ( ) { jdbcSchema = com.google.gerrit.reviewdb.server.ReviewDbWrapper.unwrapJbdcSchema ( db ) ; }

Target:
public void initDb ( ) throws java.lang.Exception { jdbcSchema = com.google.gerrit.reviewdb.server.ReviewDbWrapper.unwrapJbdcSchema ( db ) ; try ( java.sql.Statement stmt = jdbcSchema.getConnection ( ) . createStatement ( ) ) { stmt.execute ( ( "CREATE TABLE account_groups (" + ( ( ( ( ( ( ( " group_uuid varchar(255) DEFAULT '' NOT NULL," + " group_id INTEGER DEFAULT 0 NOT NULL," ) + " name varchar(255) DEFAULT '' NOT NULL," ) + " created_on TIMESTAMP," ) + " description CLOB," ) + " owner_group_uuid varchar(255) DEFAULT '' NOT NULL," ) + " visible_to_all CHAR(1) DEFAULT 'N' NOT NULL" ) + ")" ) ) ) ; } }
Source:
public void byAfter ( ) throws java.lang.Exception { com.google.gerrit.testutil.TestTimeUtil.resetWithClockStep ( 30 , java.util.concurrent.TimeUnit.HOURS ) ; org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( repo , newChange ( repo ) ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( repo , newChange ( repo ) ) ; com.google.gerrit.testutil.TestTimeUtil.setClockStep ( 0 , java.util.concurrent.TimeUnit.MILLISECONDS ) ; assertQuery ( "after:2009-10-03" ) ; assertQuery ( "after:\"2009-10-01 20:59:59 -0400\"" , change2 ) ; assertQuery ( "after:\"2009-10-01 20:59:59 -0000\"" , change2 ) ; assertQuery ( "after:2009-10-01" , change2 ) ; assertQuery ( "after:2009-09-30" , change2 , change1 ) ; }

Target:
public void byAfter ( ) throws java.lang.Exception { resetTimeWithClockStep ( 30 , java.util.concurrent.TimeUnit.HOURS ) ; org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( repo , newChange ( repo ) ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( repo , newChange ( repo ) ) ; com.google.gerrit.testutil.TestTimeUtil.setClockStep ( 0 , java.util.concurrent.TimeUnit.MILLISECONDS ) ; assertQuery ( "after:2009-10-03" ) ; assertQuery ( "after:\"2009-10-01 20:59:59 -0400\"" , change2 ) ; assertQuery ( "after:\"2009-10-01 20:59:59 -0000\"" , change2 ) ; assertQuery ( "after:2009-10-01" , change2 ) ; assertQuery ( "after:2009-09-30" , change2 , change1 ) ; }
Source:
public void testGc ( ) throws com.jcraft.jsch.JSchException , java.io.IOException { java.lang.String response = sshSession.exec ( ( ( ( ( "gerrit gc \"" + ( project1.get ( ) ) ) + "\" \"" ) + ( project2.get ( ) ) ) + "\"" ) ) ; org.junit.Assert.assertFalse ( sshSession.hasError ( ) ) ; assertNoError ( response ) ; gcAssert.assertHasPackFile ( project1 , project2 ) ; gcAssert.assertHasNoPackFile ( allProjects , project3 ) ; }

Target:
public void testGc ( ) throws com.jcraft.jsch.JSchException , java.io.IOException { java.lang.String response = sshSession.exec ( ( ( ( ( "gerrit gc \"" + ( project1.get ( ) ) ) + "\" \"" ) + ( project2.get ( ) ) ) + "\"" ) ) ; org.junit.Assert.assertFalse ( sshSession.getError ( ) , sshSession.hasError ( ) ) ; assertNoError ( response ) ; gcAssert.assertHasPackFile ( project1 , project2 ) ; gcAssert.assertHasNoPackFile ( allProjects , project3 ) ; }
Source:
public com.google.gerrit.common.data.PatchScript call ( ) throws java.lang.Exception { com.google.gerrit.server.project.ChangeControl control = changeControlFactory.validateFor ( patchKey.getParentKey ( ) . getParentKey ( ) , getCurrentUser ( ) ) ; return patchScriptFactoryFactory.create ( control , patchKey.getFileName ( ) , psa , psb , dp ) . call ( ) ; }

Target:
public com.google.gerrit.common.data.PatchScript call ( ) throws java.lang.Exception { com.google.gerrit.server.project.ChangeControl control = changeControlFactory.validateFor ( patchKey.getParentKey ( ) . getParentKey ( ) , getUser ( ) ) ; return patchScriptFactoryFactory.create ( control , patchKey.getFileName ( ) , psa , psb , dp ) . call ( ) ; }
Source:
public java.lang.String getPluginName ( java.io.File srcFile ) { try { return com.google.common.base.Objects.firstNonNull ( com.google.gerrit.server.plugins.JarPluginProvider.getJarPluginName ( srcFile ) , com.google.gerrit.server.plugins.PluginLoader.nameOf ( srcFile ) ) ; } catch ( java.io.IOException e ) { throw new java.lang.IllegalArgumentException ( ( ( "Invalid plugin file " + srcFile ) + ": cannot get plugin name" ) , e ) ; } }

Target:
public java.lang.String getPluginName ( java.io.File srcFile ) { try { return com.google.common.base.MoreObjects.firstNonNull ( com.google.gerrit.server.plugins.JarPluginProvider.getJarPluginName ( srcFile ) , com.google.gerrit.server.plugins.PluginLoader.nameOf ( srcFile ) ) ; } catch ( java.io.IOException e ) { throw new java.lang.IllegalArgumentException ( ( ( "Invalid plugin file " + srcFile ) + ": cannot get plugin name" ) , e ) ; } }
Source:
public com.google.gerrit.reviewdb.client.AccountGroup get ( final com.google.gerrit.reviewdb.client.AccountGroup.Id groupId ) { return byId.get ( groupId ) ; }

Target:
public com.google.gerrit.reviewdb.client.AccountGroup get ( final com.google.gerrit.reviewdb.client.AccountGroup.Id groupId ) { try { com.google.common.base.Optional < com.google.gerrit.reviewdb.client.AccountGroup > g = byId.get ( groupId ) ; return g.isPresent ( ) ? g.get ( ) : com.google.gerrit.server.account.GroupCacheImpl.missing ( groupId ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.account.GroupCacheImpl.log.warn ( ( "Cannot load group " + groupId ) , e ) ; return com.google.gerrit.server.account.GroupCacheImpl.missing ( groupId ) ; } }
Source:
private void assertBlock ( java.util.List < com.google.gerrit.server.mail.send.CommentFormatter.Block > list , int index , com.google.gerrit.server.mail.send.CommentFormatter.BlockType type , java.lang.String text ) { com.google.gerrit.server.mail.send.CommentFormatter.Block block = list.get ( index ) ; com.google.common.truth.Truth.assertThat ( block.type ) . isEqualTo ( type ) ; com.google.common.truth.Truth.assertThat ( block.text ) . isEqualTo ( text ) ; com.google.common.truth.Truth.assertThat ( block.items ) . isNull ( ) ; }

Target:
private void assertBlock ( java.util.List < com.google.gerrit.server.mail.send.CommentFormatter.Block > list , int index , com.google.gerrit.server.mail.send.CommentFormatter.BlockType type , java.lang.String text ) { com.google.gerrit.server.mail.send.CommentFormatter.Block block = list.get ( index ) ; com.google.common.truth.Truth.assertThat ( block.type ) . isEqualTo ( type ) ; com.google.common.truth.Truth.assertThat ( block.text ) . isEqualTo ( text ) ; com.google.common.truth.Truth.assertThat ( block.items ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( block.quotedBlocks ) . isNull ( ) ; }
Source:
public void run ( ) { while ( true ) { if ( stop ) { break ; } try { java.lang.Thread.sleep ( 100 ) ; } catch ( java.lang.InterruptedException e ) { com.google.gerrit.lucene.LuceneChangeIndex.log.warn ( "error refreshing index searchers" , e ) ; } openIndex.maybeRefresh ( ) ; closedIndex.maybeRefresh ( ) ; } }

Target:
public void run ( ) { while ( ! ( stop ) ) { openIndex.maybeRefresh ( ) ; closedIndex.maybeRefresh ( ) ; synchronized ( this ) { try { wait ( 100 ) ; } catch ( java.lang.InterruptedException e ) { com.google.gerrit.lucene.LuceneChangeIndex.log.warn ( "error refreshing index searchers" , e ) ; } } } }
Source:
protected void init ( ) throws com.google.gerrit.common.errors.EmailException { super . init ( ) ; if ( ( fromId ) != null ) { reviewers.remove ( fromId ) ; } add ( RecipientType.TO , reviewers ) ; add ( RecipientType.CC , extraCC ) ; rcptToAuthors ( RecipientType.CC ) ; bccStarredBy ( ) ; includeWatchers ( NotifyType.NEW_PATCHSETS , ( ! ( patchSet.isDraft ( ) ) ) ) ; }

Target:
protected void init ( ) throws com.google.gerrit.common.errors.EmailException { super . init ( ) ; if ( ( fromId ) != null ) { reviewers.remove ( fromId ) ; } add ( RecipientType.TO , reviewers ) ; add ( RecipientType.CC , extraCC ) ; rcptToAuthors ( RecipientType.CC ) ; bccStarredBy ( ) ; includeWatchers ( NotifyType.NEW_PATCHSETS , ( ! ( patchSet.isDraft ( ) ) ) ) ; removeUsersThatIgnoredTheChange ( ) ; }
Source:
public com.google.gerrit.extensions.api.projects.ChildProjectApi child ( java.lang.String name ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return childApi.create ( children.parse ( checkExists ( ) , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( name ) ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot parse child project" , e ) ; } }

Target:
public com.google.gerrit.extensions.api.projects.ChildProjectApi child ( java.lang.String name ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return childApi.create ( children.parse ( checkExists ( ) , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( name ) ) ) ; } catch ( java.io.IOException | com.google.gerrit.server.permissions.PermissionBackendException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot parse child project" , e ) ; } }
Source:
public void pruneSchema ( com.google.gwtorm.server.StatementExecutor e , java.util.List < java.lang.String > prune ) { for ( java.lang.String p : prune ) { if ( ! ( pruneList.contains ( p ) ) ) { pruneList.add ( p ) ; } } }

Target:
void start ( com.google.gerrit.pgm.SiteRun run ) throws java.lang.Exception { if ( run.flags.autoStart ) { if ( com.google.gerrit.server.util.HostPlatform.isWin32 ( ) ) { java.lang.System.err.println ( "Automatic startup not supported on Win32." ) ; } else { startDaemon ( run ) ; if ( ! ( run.ui.isBatch ( ) ) ) { browser.open ( PageLinks.ADMIN_PROJECTS ) ; } } } }
Source:
public static void removeGpgKeys ( java.lang.String account , java.lang.Iterable < java.lang.String > fingerprints , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.account.GpgKeyInfo > > cb ) { new com.google.gerrit.client.rpc.RestApi ( "/accounts/" ) . id ( account ) . view ( "gpgkeys" ) . post ( com.google.gerrit.client.account.AccountApi.GpgKeysInput.remove ( fingerprints ) , cb ) ; }

Target:
public static void deleteGpgKeys ( java.lang.String account , java.lang.Iterable < java.lang.String > fingerprints , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.account.GpgKeyInfo > > cb ) { new com.google.gerrit.client.rpc.RestApi ( "/accounts/" ) . id ( account ) . view ( "gpgkeys" ) . post ( com.google.gerrit.client.account.AccountApi.GpgKeysInput.delete ( fingerprints ) , cb ) ; }
Source:
public void testParseMultiLineQuote ( ) { java.lang.String comment = "> Quote line 1\n> Quote line 2\n > Quote line 3\n" ; java.util.List < com.google.gerrit.server.mail.send.CommentFormatter.Block > result = com.google.gerrit.server.mail.send.CommentFormatter.parse ( comment ) ; com.google.common.truth.Truth.assertThat ( result ) . hasSize ( 1 ) ; assertBlock ( result , 0 , BlockType.QUOTE , "Quote line 1\nQuote line 2\nQuote line 3" ) ; }

Target:
public void testParseMultiLineQuote ( ) { java.lang.String comment = "> Quote line 1\n> Quote line 2\n > Quote line 3\n" ; java.util.List < com.google.gerrit.server.mail.send.CommentFormatter.Block > result = com.google.gerrit.server.mail.send.CommentFormatter.parse ( comment ) ; com.google.common.truth.Truth.assertThat ( result ) . hasSize ( 1 ) ; assertQuoteBlock ( result , 0 , 1 ) ; assertBlock ( result.get ( 0 ) . quotedBlocks , 0 , BlockType.PARAGRAPH , "Quote line 1\nQuote line 2\nQuote line 3\n" ) ; }
Source:
void finish ( ) { try { id = com.google.common.base.Joiner.on ( '~' ) . join ( java.net.URLEncoder.encode ( project , "UTF-8" ) , java.net.URLEncoder.encode ( branch , "UTF-8" ) , java.net.URLEncoder.encode ( changeId , "UTF-8" ) ) ; } catch ( java.io.UnsupportedEncodingException e ) { com.google.gerrit.server.change.ChangeJson.log.error ( "Cannot encode components for id" , e ) ; } }

Target:
void finish ( ) { id = com.google.common.base.Joiner.on ( '~' ) . join ( com.google.gerrit.server.util.Url.encode ( project ) , com.google.gerrit.server.util.Url.encode ( branch ) , com.google.gerrit.server.util.Url.encode ( changeId ) ) ; }
Source:
public void deleteReviewerFromReviewableChangeByOwnerCcingSelfNotifyOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; setEmailStrategy ( sc.owner , EmailStrategy.CC_ON_OWN_COMMENTS ) ; removeReviewer ( sc , extraReviewer , NotifyHandling.OWNER ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . to ( sc.owner , extraReviewer ) . notTo ( extraCcer , sc.reviewer , sc.ccer ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( sc.starrer ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteReviewerFromReviewableChangeNotifyNone ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChangeWithExtraReviewer ( ) ; removeReviewer ( sc , extraReviewer , NotifyHandling.NONE ) ; assertThat ( sender ) . notSent ( ) ; }
Source:
public boolean isLoggedIn ( ) { boolean loggedIn = ( ( token ) != null ) && ( ( hub ) != null ) ; if ( loggedIn && ( ( myself ) == null ) ) { try { myself = hub.getMyself ( ) ; } catch ( java.lang.Throwable e ) { com.googlesource.gerrit.plugins.github.oauth.GitHubLogin.LOG.error ( "Connection to GitHub broken: logging out" , e ) ; logout ( ) ; loggedIn = false ; } } return loggedIn ; }

Target:
public boolean isLoggedIn ( ) { boolean loggedIn = ( ( token ) != null ) && ( ( hub ) != null ) ; if ( loggedIn && ( ( myself ) == null ) ) { try { myself = hub.getMyself ( ) ; } catch ( java.lang.Throwable e ) { com.googlesource.gerrit.plugins.github.oauth.GitHubLogin.log.error ( "Connection to GitHub broken: logging out" , e ) ; logout ( ) ; loggedIn = false ; } } return loggedIn ; }
Source:
public void onSuccess ( com.googlesource.gerrit.plugins.xdocs.client.ChangeInfo.EditInfo edit ) { if ( edit != null ) { change.revisions ( ) . put ( edit.name ( ) , com.googlesource.gerrit.plugins.xdocs.client.ChangeInfo.RevisionInfo.fromEdit ( edit ) ) ; } initRevisionsAndShow ( change ) ; }

Target:
public void onSuccess ( com.googlesource.gerrit.plugins.xdocs.client.ChangeInfo.EditInfo edit ) { if ( edit != null ) { change.set_edit ( edit ) ; change.revisions ( ) . put ( edit.name ( ) , com.googlesource.gerrit.plugins.xdocs.client.ChangeInfo.RevisionInfo.fromEdit ( edit ) ) ; } initRevisionsAndShow ( change ) ; }
Source:
public void testDeleteOneNotExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement delete = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.DELETE , 0 ) ; com.google.gwtorm.jdbc.JdbcAccess < com.google.gwtorm.jdbc.TestJdbcAccess.Data , com.google.gwtorm.jdbc.TestJdbcAccess.Data.DataKey > classUnderTest = createClassUnderTest ( ) ; try { classUnderTest.delete ( oneRow ) ; org.junit.Assert.fail ( "missing OrmConcurrencyException" ) ; } catch ( com.google.gwtorm.server.OrmConcurrencyException e ) { } com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( delete ) ; }

Target:
public void deleteTwoNotExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement delete = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.DELETE , 0 , 1 ) ; try { classUnderTest.delete ( twoRows ) ; org.junit.Assert.fail ( "missing OrmConcurrencyException" ) ; } catch ( com.google.gwtorm.server.OrmConcurrencyException e ) { } assertCorrectUpdating ( delete , 1 , 2 ) ; }
Source:
public void createProjectDuplicate ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.name = name ( "baz" ) ; gApi.projects ( ) . create ( in ) ; gApi.projects ( ) . create ( in ) ; }

Target:
public void createProjectDuplicate ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.name = name ( "baz" ) ; gApi.projects ( ) . create ( in ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceConflictException.class ) ; exception.expectMessage ( "Project already exists" ) ; gApi.projects ( ) . create ( in ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.changes.CommentInfo result ) { done.setEnabled ( true ) ; setOpen ( false ) ; com.google.gerrit.client.diff.DraftBox box = parent.addDraftBox ( result ) ; registerReplyBox ( box ) ; if ( ! ( getCommentInfo ( ) . has_line ( ) ) ) { parent.addFileCommentBox ( box , comment.side ( ) ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.changes.CommentInfo result ) { done.setEnabled ( true ) ; setOpen ( false ) ; com.google.gerrit.client.diff.DraftBox box = parent.addDraftBox ( result , getSide ( ) ) ; registerReplyBox ( box ) ; if ( ! ( getCommentInfo ( ) . has_line ( ) ) ) { parent.addFileCommentBox ( box ) ; } }
Source:
private void executeIndexTask ( int id , boolean deleted ) { if ( ! ( com.ericsson.gerrit.plugins.syncindex.Context.isForwardedEvent ( ) ) ) { com.ericsson.gerrit.plugins.syncindex.IndexEventHandler.SyncIndexTask syncIndexTask = new com.ericsson.gerrit.plugins.syncindex.IndexEventHandler.SyncIndexTask ( id , deleted ) ; if ( queuedTasks.add ( syncIndexTask ) ) { executor.execute ( syncIndexTask ) ; } } }

Target:
private void executeIndexTask ( int id , boolean deleted ) { if ( ! ( com.ericsson.gerrit.plugins.highavailability.Context.isForwardedEvent ( ) ) ) { com.ericsson.gerrit.plugins.highavailability.IndexEventHandler.SyncIndexTask syncIndexTask = new com.ericsson.gerrit.plugins.highavailability.IndexEventHandler.SyncIndexTask ( id , deleted ) ; if ( queuedTasks.add ( syncIndexTask ) ) { executor.execute ( syncIndexTask ) ; } } }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { final com.google.gwt.user.client.ui.HTMLTable.Cell cell = table.getCellForEvent ( event ) ; if ( ( ( cell != null ) && ( ( cell.getCellIndex ( ) ) != 1 ) ) && ( ( getRowItem ( cell.getRowIndex ( ) ) ) != null ) ) { movePointerTo ( cell.getRowIndex ( ) ) ; } }

Target:
public void onSuccess ( final java.util.Set < com.google.gerrit.client.reviewdb.Branch.NameKey > deleted ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.client.reviewdb.Branch k = getRowItem ( row ) ; if ( ( k != null ) && ( deleted.contains ( k.getNameKey ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }
Source:
public com.google.gerrit.reviewdb.Change update ( com.google.gerrit.reviewdb.Change change ) { if ( ( change.getStatus ( ) . isOpen ( ) ) && ( change.currentPatchSetId ( ) . equals ( patchSetId ) ) ) { change.setStatus ( Change.Status.ABANDONED ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; return change ; } else { return null ; } }

Target:
public com.google.gerrit.common.data.ChangeDetail call ( ) throws com.google.gerrit.common.errors.NoSuchEntityException , com.google.gerrit.server.mail.EmailException , com.google.gerrit.server.patch.PatchSetInfoNotAvailableException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.client.OrmException { final com.google.gerrit.reviewdb.Change.Id changeId = patchSetId.getParentKey ( ) ; final com.google.gerrit.server.project.ChangeControl control = changeControlFactory.validateFor ( changeId ) ; if ( ! ( control.canAbandon ( ) ) ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } com.google.gerrit.server.ChangeUtil.abandon ( patchSetId , currentUser , message , db , abandonedSenderFactory , hooks ) ; return changeDetailFactory.create ( changeId ) . call ( ) ; }
Source:
private com.google.gerrit.extensions.api.changes.ReviewResult review ( java.lang.String changeId , java.lang.String revisionId , com.google.gerrit.extensions.api.changes.ReviewInput in ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse resp = adminRestSession.post ( ( ( ( ( "/changes/" + changeId ) + "/revisions/" ) + revisionId ) + "/review" ) , in ) ; return com.google.gerrit.acceptance.rest.change.ChangeReviewersIT.readContentFromJson ( resp , com.google.gerrit.extensions.api.changes.ReviewResult.class ) ; }

Target:
private com.google.gerrit.extensions.api.changes.ReviewResult review ( java.lang.String changeId , java.lang.String revisionId , com.google.gerrit.extensions.api.changes.ReviewInput in , int expectedStatus ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse resp = adminRestSession.post ( ( ( ( ( "/changes/" + changeId ) + "/revisions/" ) + revisionId ) + "/review" ) , in ) ; return com.google.gerrit.acceptance.rest.change.ChangeReviewersIT.readContentFromJson ( resp , expectedStatus , com.google.gerrit.extensions.api.changes.ReviewResult.class ) ; }
Source:
public void testPreformat1 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.html ( "A\n\n This is pre\n formatted" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; org.junit.Assert.assertNotSame ( o , n ) ; org.junit.Assert.assertEquals ( ( ( ( ( "<p>A</p>" + "<p>" ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " This is pre" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " formatted" ) ) ) + "</p>" ) , n.asString ( ) ) ; }

Target:
public void testPreformat1 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.html ( "A\n\n This is pre\n formatted" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; com.google.common.truth.Truth.assertThat ( o ) . isNotSameAs ( n ) ; com.google.common.truth.Truth.assertThat ( n.asString ( ) ) . isEqualTo ( ( ( ( ( "<p>A</p>" + "<p>" ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " This is pre" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " formatted" ) ) ) + "</p>" ) ) ; }
Source:
public com.google.gerrit.extensions.auth.oauth.OAuthToken getAccessToken ( com.google.gerrit.extensions.auth.oauth.OAuthVerifier rv ) { return com.googlesource.gerrit.plugins.cfoauth.CFOAuthService.getAsOAuthToken ( uaaClient.getAccessToken ( rv.getValue ( ) ) ) ; }

Target:
public com.google.gerrit.extensions.auth.oauth.OAuthToken getAccessToken ( com.google.gerrit.extensions.auth.oauth.OAuthVerifier rv ) { if ( ( rv == null ) || ( ( rv.getValue ( ) ) == null ) ) { throw new com.googlesource.gerrit.plugins.cfoauth.UAAClientException ( "Must provide an authorization code" ) ; } return com.googlesource.gerrit.plugins.cfoauth.CFOAuthService.getAsOAuthToken ( uaaClient.getAccessToken ( rv.getValue ( ) ) ) ; }
Source:
private com.google.gerrit.client.diff.DraftBox addNewDraft ( net.codemirror.lib.CodeMirror cm , int line , net.codemirror.lib.TextMarker.FromTo fromTo ) { com.google.gerrit.client.diff.DisplaySide side = getSideFromCm ( cm ) ; return addDraftBox ( com.google.gerrit.client.changes.CommentInfo.createRange ( path , getStoredSideFromDisplaySide ( side ) , ( line + 1 ) , null , null , com.google.gerrit.client.diff.CommentRange.create ( fromTo ) ) , side ) ; }

Target:
protected void preDisplay ( com.google.gerrit.client.projects.ConfigInfoCache.Entry result ) { commentManager = new com.google.gerrit.client.diff.CommentManager ( this , base , revision , path , result.getCommentLinkProcessor ( ) ) ; setTheme ( result.getTheme ( ) ) ; display ( comments ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.class ) ; bind ( com.google.gerrit.server.plugins.PluginLoader.class ) ; bind ( com.google.gerrit.server.plugins.CopyConfigModule.class ) ; listener ( ) . to ( com.google.gerrit.server.plugins.PluginLoader.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.plugins.ServerInformationImpl.class ) ; bind ( com.google.gerrit.extensions.systemstatus.ServerInformation.class ) . to ( com.google.gerrit.server.plugins.ServerInformationImpl.class ) ; bind ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.class ) ; bind ( com.google.gerrit.server.plugins.PluginLoader.class ) ; bind ( com.google.gerrit.server.plugins.CopyConfigModule.class ) ; listener ( ) . to ( com.google.gerrit.server.plugins.PluginLoader.class ) ; }
Source:
void stop ( ) throws java.lang.Exception { try { if ( com.google.gerrit.testutil.NoteDbMode.get ( ) . equals ( NoteDbMode.CHECK ) ) { testInjector.getInstance ( com.google.gerrit.testutil.NoteDbChecker.class ) . rebuildAndCheckAllChanges ( ) ; } } finally { daemon.getLifecycleManager ( ) . stop ( ) ; if ( ( daemonService ) != null ) { java.lang.System.out.println ( "Gerrit Server Shutdown" ) ; daemonService.shutdownNow ( ) ; daemonService.awaitTermination ( java.lang.Long.MAX_VALUE , java.util.concurrent.TimeUnit.SECONDS ) ; } org.eclipse.jgit.lib.RepositoryCache.clear ( ) ; } }

Target:
void stop ( ) throws java.lang.Exception { try { checkNoteDbState ( ) ; } finally { daemon.getLifecycleManager ( ) . stop ( ) ; if ( ( daemonService ) != null ) { java.lang.System.out.println ( "Gerrit Server Shutdown" ) ; daemonService.shutdownNow ( ) ; daemonService.awaitTermination ( java.lang.Long.MAX_VALUE , java.util.concurrent.TimeUnit.SECONDS ) ; } org.eclipse.jgit.lib.RepositoryCache.clear ( ) ; } }
Source:
private void dropRemovedDisabledPlugins ( java.util.List < java.io.File > jars ) { java.util.Set < java.lang.String > unload = com.google.common.collect.Sets.newHashSet ( disabled.keySet ( ) ) ; for ( java.io.File jar : jars ) { unload.remove ( com.google.gerrit.server.plugins.PluginLoader.nameOf ( jar ) ) ; } for ( java.lang.String name : unload ) { disabled.remove ( name ) ; } }

Target:
private void stopRemovedPlugins ( java.util.List < java.io.File > jars ) { java.util.Set < java.lang.String > unload = com.google.common.collect.Sets.newHashSet ( running.keySet ( ) ) ; for ( java.io.File jar : jars ) { if ( ! ( jar.getName ( ) . endsWith ( ".disabled" ) ) ) { unload.remove ( com.google.gerrit.server.plugins.PluginLoader.nameOf ( jar ) ) ; } } for ( java.lang.String name : unload ) { com.google.gerrit.server.plugins.PluginLoader.log.info ( java.lang.String.format ( "Unloading plugin %s" , name ) ) ; running.remove ( name ) . stop ( ) ; } }
Source:
public void testCreateSchema_LabelTypes ( ) throws java.lang.Exception { java.util.List < java.lang.String > labels = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.common.data.LabelType label : getLabelTypes ( ) . getLabelTypes ( ) ) { labels.add ( label.getName ( ) ) ; } org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( "Code-Review" ) , labels ) ; }

Target:
public void testCreateSchema_LabelTypes ( ) throws java.lang.Exception { java.util.List < java.lang.String > labels = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.common.data.LabelType label : getLabelTypes ( ) . getLabelTypes ( ) ) { labels.add ( label.getName ( ) ) ; } com.google.common.truth.Truth.assertThat ( labels ) . containsExactly ( "Code-Review" ) ; }
Source:
public java.lang.String getGitHttpUrl ( ) throws java.net.UnknownHostException { java.lang.String httpListenUrl = getHttpListenUrl ( ) ; if ( httpListenUrl == null ) { return "" ; } if ( ( ! ( downloadSchemes.isEmpty ( ) ) ) && ( ! ( downloadSchemes.contains ( "http" ) ) ) ) { return "" ; } java.lang.String httpUrl = com.google.common.base.Objects.firstNonNull ( canonicalWebUrlString , httpListenUrl ) ; httpUrl = httpUrl.replace ( "://" , ( ( "://" + ( com.googlesource.gerrit.plugins.gitblit.GitBlitUrlsConfig.GITBLIT_USER ) ) + "@" ) ) ; httpUrl += ( httpUrl.endsWith ( "/" ) ? "" : "/" ) + ( com.googlesource.gerrit.plugins.gitblit.GitBlitUrlsConfig.GITBLIT_REPO ) ; return httpUrl ; }

Target:
public java.lang.String getGitHttpUrl ( ) throws java.net.UnknownHostException { java.lang.String httpListenUrl = getHttpListenUrl ( ) ; if ( httpListenUrl == null ) { return "" ; } if ( ( ! ( downloadSchemes.isEmpty ( ) ) ) && ( ! ( downloadSchemes.contains ( "http" ) ) ) ) { return "" ; } java.lang.String httpUrl = com.google.common.base.MoreObjects.firstNonNull ( canonicalWebUrlString , httpListenUrl ) ; httpUrl = httpUrl.replace ( "://" , ( ( "://" + ( com.googlesource.gerrit.plugins.gitblit.GitBlitUrlsConfig.GITBLIT_USER ) ) + "@" ) ) ; httpUrl += ( httpUrl.endsWith ( "/" ) ? "" : "/" ) + ( com.googlesource.gerrit.plugins.gitblit.GitBlitUrlsConfig.GITBLIT_REPO ) ; return httpUrl ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; Util.GROUP_SVC.visibleGroups ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.common.data.GroupList > ( this ) { @ java.lang.Override protected void preDisplay ( com.google.gerrit.common.data.GroupList result ) { groups.display ( result.getGroups ( ) ) ; groups.finishDisplay ( ) ; } } ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.groups.GroupMap.all ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.groups.GroupMap > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.client.groups.GroupMap result ) { groups.display ( result ) ; groups.finishDisplay ( ) ; } } ) ; }
Source:
public org.eclipse.jgit.lib.BatchRefUpdate execute ( boolean dryrun ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( migration.failChangeWrites ( ) ) { throw new com.google.gwtorm.server.OrmException ( com.google.gerrit.server.notedb.NoteDbUpdateManager.CHANGES_READ_ONLY ) ; } if ( isEmpty ( ) ) { return null ; } try ( com.google.gerrit.metrics.Timer1.Context timer = metrics.updateLatency.start ( com.google.gerrit.server.notedb.NoteDbTable.CHANGES ) ) { stage ( ) ; org.eclipse.jgit.lib.BatchRefUpdate result = execute ( changeRepo , dryrun ) ; execute ( allUsersRepo , dryrun ) ; return result ; } finally { close ( ) ; } }

Target:
public org.eclipse.jgit.lib.BatchRefUpdate execute ( boolean dryrun ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( migration.failChangeWrites ( ) ) { throw new com.google.gwtorm.server.OrmException ( com.google.gerrit.server.notedb.NoteDbUpdateManager.CHANGES_READ_ONLY ) ; } if ( isEmpty ( ) ) { return null ; } try ( com.google.gerrit.metrics.Timer1.Context timer = metrics.updateLatency.start ( com.google.gerrit.server.notedb.NoteDbTable.CHANGES ) ) { stage ( ) ; org.eclipse.jgit.lib.BatchRefUpdate result = execute ( changeRepo , dryrun , pushCert ) ; execute ( allUsersRepo , dryrun , null ) ; return result ; } finally { close ( ) ; } }
Source:
public void updateComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) throws com.google.gwtorm.server.OrmException { verifyComment ( c ) ; com.google.common.base.Preconditions.checkArgument ( ( ( c.getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.PatchLineComment.Status.DRAFT ) ) , "Cannot update a published comment into a ChangeDraftUpdate" ) ; if ( migration.readComments ( ) ) { com.google.common.base.Preconditions.checkArgument ( draftNotes.containsComment ( c ) , "Cannot update this comment because it didn't exist previously" ) ; } upsertComments.add ( c ) ; }

Target:
public void updateComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) throws com.google.gwtorm.server.OrmException { verifyComment ( c ) ; com.google.common.base.Preconditions.checkArgument ( ( ( c.getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.PatchLineComment.Status.DRAFT ) ) , "Cannot update a published comment into a ChangeDraftUpdate" ) ; if ( migration.readChanges ( ) ) { com.google.common.base.Preconditions.checkArgument ( draftNotes.load ( ) . containsComment ( c ) , "Cannot update this comment because it didn't exist previously" ) ; } upsertComments.add ( c ) ; }
Source:
private java.lang.Iterable < java.lang.String > getDraftRefs ( final com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { java.util.Set < java.lang.String > refNames = getRefNamesAllUsers ( RefNames.REFS_DRAFT_COMMENTS ) ; final java.lang.String suffix = "/" + ( changeId.get ( ) ) ; return com.google.common.collect.Iterables.filter ( refNames , new com.google.common.base.Predicate < java.lang.String > ( ) { @ java.lang.Override public boolean apply ( java.lang.String input ) { return input.endsWith ( suffix ) ; } } ) ; }

Target:
private java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > getDraftRefs ( com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openMetadataRepository ( allUsers ) ) { return getDraftRefs ( repo , changeId ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }
Source:
private boolean reindex ( ) throws java.io.IOException { boolean ok = true ; for ( com.google.gerrit.server.index.IndexDefinition < ? , ? , ? > def : indexDefs ) { if ( ( indices.isEmpty ( ) ) || ( indices.contains ( def.getName ( ) ) ) ) { ok &= reindex ( def ) ; } } return ok ; }

Target:
private boolean reindex ( ) throws java.io.IOException { boolean ok = true ; for ( com.google.gerrit.index.IndexDefinition < ? , ? , ? > def : indexDefs ) { if ( ( indices.isEmpty ( ) ) || ( indices.contains ( def.getName ( ) ) ) ) { ok &= reindex ( def ) ; } } return ok ; }
Source:
public void generatePreparedStatementSet ( final com.google.gwtorm.jdbc.gen.CodeGenSupport cgs ) { cgs.pushSqlHandle ( ) ; cgs.pushColumnIndex ( ) ; cgs.pushFieldValue ( ) ; cgs.mv.visitMethodInsn ( Opcodes.INVOKESTATIC , org.objectweb.asm.Type.getInternalName ( com.google.gwtorm.schema.sql.SqlByteArrayTypeInfo.class ) , "toPreparedStatement" , org.objectweb.asm.Type.getMethodDescriptor ( Type.VOID_TYPE , new org.objectweb.asm.Type [ ] { org.objectweb.asm.Type.getType ( java.sql.PreparedStatement.class ) , org.objectweb.asm.Type.INT_TYPE , org.objectweb.asm.Type.getType ( byte [ ] . class ) } ) ) ; }

Target:
public void generatePreparedStatementSet ( final com.google.gwtorm.server.CodeGenSupport cgs ) { cgs.pushSqlHandle ( ) ; cgs.pushColumnIndex ( ) ; cgs.pushFieldValue ( ) ; cgs.mv.visitMethodInsn ( Opcodes.INVOKESTATIC , org.objectweb.asm.Type.getInternalName ( com.google.gwtorm.schema.sql.SqlByteArrayTypeInfo.class ) , "toPreparedStatement" , org.objectweb.asm.Type.getMethodDescriptor ( Type.VOID_TYPE , new org.objectweb.asm.Type [ ] { org.objectweb.asm.Type.getType ( java.sql.PreparedStatement.class ) , org.objectweb.asm.Type.INT_TYPE , org.objectweb.asm.Type.getType ( byte [ ] . class ) } ) ) ; }
Source:
public void preferInsertAtLineBreak2 ( ) throws java.lang.Exception { java.lang.String a = " abc\n def\n" ; java.lang.String b = " abc\n def\n" ; java.util.List < org.eclipse.jgit.diff.Edit > expected = new org.eclipse.jgit.diff.EditList ( ) ; expected.add ( new org.eclipse.jgit.diff.Edit ( 0 , 0 , 0 , 2 ) ) ; expected.add ( new org.eclipse.jgit.diff.Edit ( 6 , 6 , 8 , 10 ) ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.patch.IntraLineLoaderTest.intraline ( a , b ) ) . isEqualTo ( expected ) ; }

Target:
public void insertedWhitespaceIsRecognizedInMultipleLines ( ) throws java.lang.Exception { java.lang.String a = " int *foobar\n int *foobar\n" ; java.lang.String b = " int * foobar\n int * foobar\n" ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.patch.IntraLineLoaderTest.intraline ( a , b ) ) . isEqualTo ( com.google.gerrit.server.patch.IntraLineLoaderTest.ref ( ) . common ( " int *" ) . insert ( " " ) . common ( "foobar\n" ) . common ( " int *" ) . insert ( " " ) . common ( "foobar\n" ) . edits ) ; }
Source:
public void defaultGroupsCreated_internals ( ) throws java.lang.Exception { java.util.Set < java.lang.String > names = com.google.common.collect.Sets.newHashSet ( ) ; for ( com.google.gerrit.reviewdb.client.AccountGroup g : db.accountGroups ( ) . all ( ) ) { names.add ( g.getName ( ) ) ; } org.junit.Assert.assertTrue ( names.contains ( "Administrators" ) ) ; org.junit.Assert.assertTrue ( names.contains ( "Non-Interactive Users" ) ) ; }

Target:
public void defaultGroupsCreated_internals ( ) throws java.lang.Exception { java.util.Set < java.lang.String > names = com.google.common.collect.Sets.newHashSet ( ) ; for ( com.google.gerrit.reviewdb.client.AccountGroup g : db.accountGroups ( ) . all ( ) ) { names.add ( g.getName ( ) ) ; } com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < ? > ) ( names ) ) ) . contains ( "Administrators" ) ; com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < ? > ) ( names ) ) ) . contains ( "Non-Interactive Users" ) ; }
Source:
private static com.google.gerrit.server.ParamertizedString paramString ( org.eclipse.jgit.lib.Config c , java.lang.String n , java.lang.String d ) { java.lang.String expression = com.google.gerrit.server.auth.ldap.LdapRealm.optdef ( c , n , d ) ; if ( expression == null ) { return null ; } else if ( expression.contains ( "${" ) ) { return new com.google.gerrit.server.ParamertizedString ( expression ) ; } else { return new com.google.gerrit.server.ParamertizedString ( ( ( "${" + expression ) + "}" ) ) ; } }

Target:
private static com.google.gerrit.common.data.ParamertizedString paramString ( org.eclipse.jgit.lib.Config c , java.lang.String n , java.lang.String d ) { java.lang.String expression = com.google.gerrit.server.auth.ldap.LdapRealm.optdef ( c , n , d ) ; if ( expression == null ) { return null ; } else if ( expression.contains ( "${" ) ) { return new com.google.gerrit.common.data.ParamertizedString ( expression ) ; } else { return new com.google.gerrit.common.data.ParamertizedString ( ( ( "${" + expression ) + "}" ) ) ; } }
Source:
void setHeaderVisible ( boolean show ) { com.google.gerrit.client.Gerrit.setHeaderVisible ( show ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( patchSetNavRow , show ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( fileCommentRow , ( show && ( ( ( fileCommentPanelA.getBoxCount ( ) ) > 0 ) || ( ( fileCommentPanelB.getBoxCount ( ) ) > 0 ) ) ) ) ; host.resizeCodeMirror ( ) ; }

Target:
void setHeaderVisible ( boolean show ) { com.google.gerrit.client.Gerrit.setHeaderVisible ( show ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( patchSetNavRow , show ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( fileCommentRow , ( show && ( ( ( fileCommentPanelA.getBoxCount ( ) ) > 0 ) || ( ( fileCommentPanelB.getBoxCount ( ) ) > 0 ) ) ) ) ; if ( show ) { host.header.removeStyleName ( com.google.gerrit.client.diff.DiffTable.style.fullscreen ( ) ) ; } else { host.header.addStyleName ( com.google.gerrit.client.diff.DiffTable.style.fullscreen ( ) ) ; } host.resizeCodeMirror ( ) ; }
Source:
public void setParams ( com.google.common.collect.Multimap < java.lang.String , java.lang.String > params ) { this . hasQuery2 = params.containsKey ( "query2" ) ; }

Target:
public void setParams ( com.google.common.collect.ListMultimap < java.lang.String , java.lang.String > params ) throws com.google.gerrit.extensions.restapi.BadRequestException { if ( ( params.containsKey ( "query" ) ) && ( params.containsKey ( "query2" ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "\"query\" and \"query2\" options are mutually exclusive" ) ; } this . hasQuery2 = params.containsKey ( "query2" ) ; }
Source:
void parseAll ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { walk.markStart ( walk.parseCommit ( tip ) ) ; try ( com.google.gerrit.metrics.Timer1.Context timer = metrics.parseLatency.start ( com.google.gerrit.server.notedb.NoteDbTable.CHANGES ) ) { for ( org.eclipse.jgit.revwalk.RevCommit commit : walk ) { parse ( commit ) ; } parseNotes ( ) ; allPastReviewers.addAll ( reviewers.keySet ( ) ) ; pruneReviewers ( ) ; updatePatchSetStates ( ) ; checkMandatoryFooters ( ) ; } }

Target:
void parseAll ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { walk.markStart ( walk.parseCommit ( tip ) ) ; try ( com.google.gerrit.metrics.Timer1.Context timer = metrics.parseLatency.start ( com.google.gerrit.server.notedb.NoteDbTable.CHANGES ) ) { com.google.gerrit.server.notedb.ChangeNotesCommit commit ; while ( ( commit = walk.next ( ) ) != null ) { parse ( commit ) ; } parseNotes ( ) ; allPastReviewers.addAll ( reviewers.keySet ( ) ) ; pruneReviewers ( ) ; updatePatchSetStates ( ) ; checkMandatoryFooters ( ) ; } }
Source:
private java.util.Set < java.lang.String > allRefPatterns ( java.lang.String permissionName ) { java.util.Set < java.lang.String > all = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.server.project.SectionMatcher matcher : access ( ) ) { com.google.gerrit.common.data.AccessSection section = matcher.section ; com.google.gerrit.common.data.Permission permission = section.getPermission ( permissionName ) ; if ( permission != null ) { all.add ( section.getName ( ) ) ; } } return all ; }

Target:
private java.util.Set < java.lang.String > allRefPatterns ( java.lang.String permissionName ) { java.util.Set < java.lang.String > all = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.server.project.SectionMatcher matcher : access ( ) ) { com.google.gerrit.common.data.AccessSection section = matcher.getSection ( ) ; com.google.gerrit.common.data.Permission permission = section.getPermission ( permissionName ) ; if ( permission != null ) { all.add ( section.getName ( ) ) ; } } return all ; }
Source:
private static java.lang.Object createInstance ( java.lang.Class < java.lang.Object > type ) throws java.lang.IllegalAccessException , java.lang.InstantiationException , java.lang.NoSuchMethodException , java.lang.reflect.InvocationTargetException { java.lang.reflect.Constructor < java.lang.Object > c = type.getDeclaredConstructor ( ) ; c.setAccessible ( true ) ; return c.newInstance ( ) ; }

Target:
private static java.lang.Object createInstance ( java.lang.reflect.Type type ) throws java.lang.IllegalAccessException , java.lang.InstantiationException , java.lang.NoSuchMethodException , java.lang.reflect.InvocationTargetException { if ( type instanceof java.lang.Class ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.lang.Class < java.lang.Object > clazz = ( ( java.lang.Class < java.lang.Object > ) ( type ) ) ; java.lang.reflect.Constructor < java.lang.Object > c = clazz.getDeclaredConstructor ( ) ; c.setAccessible ( true ) ; return c.newInstance ( ) ; } throw new java.lang.InstantiationException ( ( "Cannot make " + type ) ) ; }
Source:
public void onScreenLoad ( com.google.gerrit.client.ui.ScreenLoadEvent event ) { }

Target:
public void onScreenLoad ( com.google.gerrit.client.ui.ScreenLoadEvent event ) { if ( event.getScreen ( ) . getToken ( ) . equals ( getTargetHistoryToken ( ) ) ) { addStyleName ( Gerrit.RESOURCES.css ( ) . activeRow ( ) ) ; } else { removeStyleName ( Gerrit.RESOURCES.css ( ) . activeRow ( ) ) ; } }
Source:
private static java.lang.String newFileName ( final com.google.gerrit.server.patch.DiffCacheKey key , final org.spearce.jgit.patch.FileHeader fh ) { if ( fh != null ) { if ( ( org.spearce.jgit.lib.FileMode.MISSING ) == ( fh.getNewMode ( ) ) ) { return null ; } if ( FileHeader.DEV_NULL.equals ( fh.getNewName ( ) ) ) { return null ; } return fh.getNewName ( ) ; } return key.getFileName ( ) ; }

Target:
private static java.lang.String newName ( final com.google.gerrit.server.patch.PatchListEntry entry ) { switch ( entry.getChangeType ( ) ) { case DELETED : return null ; case ADDED : case MODIFIED : case COPIED : case RENAMED : default : return entry.getNewName ( ) ; } }
Source:
public static java.lang.String getFileName ( java.lang.String path ) { java.lang.String fileName = ( Patch.COMMIT_MSG.equals ( path ) ) ? "Commit Message" : path ; int s = fileName.lastIndexOf ( '/' ) ; return s >= 0 ? fileName.substring ( ( s + 1 ) ) : fileName ; }

Target:
public static java.lang.String getFileName ( java.lang.String path ) { java.lang.String fileName = ( com.googlesource.gerrit.plugins.xdocs.client.FileInfo.COMMIT_MSG.equals ( path ) ) ? "Commit Message" : path ; int s = fileName.lastIndexOf ( '/' ) ; return s >= 0 ? fileName.substring ( ( s + 1 ) ) : fileName ; }
Source:
private void styleCommentRow ( final int row ) { final com.google.gwt.user.client.ui.HTMLTable.CellFormatter fmt = table.getCellFormatter ( ) ; final com.google.gwt.user.client.Element iconCell = fmt.getElement ( row , 0 ) ; com.google.gwt.user.client.ui.UIObject.setStyleName ( com.google.gwt.user.client.DOM.getParent ( iconCell ) , Gerrit.RESOURCES.css ( ) . commentHolder ( ) , true ) ; }

Target:
private void styleCommentRow ( final int row ) { final com.google.gwt.user.client.ui.HTMLTable.CellFormatter fmt = table.getCellFormatter ( ) ; final com.google.gwt.dom.client.Element iconCell = fmt.getElement ( row , 0 ) ; com.google.gwt.user.client.ui.UIObject.setStyleName ( com.google.gwt.user.client.DOM.getParent ( iconCell ) , Gerrit.RESOURCES.css ( ) . commentHolder ( ) , true ) ; }