auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void rebaseUpToDateChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; exception.equals ( com.google.gerrit.extensions.restapi.ResourceConflictException.class ) ; exception.expectMessage ( "Change is already up to date" ) ; gApi.changes ( ) . id ( r.getChangeId ( ) ) . revision ( r.getCommit ( ) . name ( ) ) . rebase ( ) ; }

Target:
public void rebaseUpToDateChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceConflictException.class ) ; exception.expectMessage ( "Change is already up to date" ) ; gApi.changes ( ) . id ( r.getChangeId ( ) ) . revision ( r.getCommit ( ) . name ( ) ) . rebase ( ) ; }
Source:
private void alias ( final java.lang.String from , final java.lang.String to ) { bind ( com.google.gerrit.server.ssh.Commands.key ( from ) ) . toProvider ( getProvider ( com.google.gerrit.server.ssh.Commands.key ( to ) ) ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.ssh.Sshd.class ) . to ( com.google.gerrit.server.ssh.GerritSshDaemon.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( org.apache.sshd.server.CommandFactory.class ) . toProvider ( com.google.gerrit.server.ssh.CommandFactoryProvider.class ) ; bind ( org.apache.sshd.server.PublickeyAuthenticator.class ) . to ( com.google.gerrit.server.ssh.DatabasePubKeyAuth.class ) ; install ( new com.google.gerrit.server.ssh.commands.DefaultCommandModule ( ) ) ; }
Source:
public boolean verifyAuthInfo ( java.lang.String authToken , java.lang.String operation , org.eclipse.jgit.lfs.lib.AnyLongObjectId id ) { com.google.common.base.Optional < com.googlesource.gerrit.plugins.lfs.fs.LfsFsRequestAuthorizer.LfsFsAuthToken > token = processor.deserialize ( authToken ) ; if ( ! ( token.isPresent ( ) ) ) { return false ; } return new com.googlesource.gerrit.plugins.lfs.fs.LfsFsRequestAuthorizer.LfsFsAuthTokenVerifier ( token.get ( ) , operation , id ) . verify ( ) ; }

Target:
public boolean verifyAuthInfo ( java.lang.String authToken , java.lang.String operation , org.eclipse.jgit.lfs.lib.AnyLongObjectId id ) { com.google.common.base.Optional < com.googlesource.gerrit.plugins.lfs.fs.LfsFsRequestAuthorizer.LfsFsAuthToken > token = processor.deserialize ( authToken ) ; if ( ! ( token.isPresent ( ) ) ) { return false ; } return new com.googlesource.gerrit.plugins.lfs.fs.LfsFsRequestAuthorizer.Verifier ( token.get ( ) , operation , id ) . verify ( ) ; }
Source:
private void initApprovals ( final com.google.gerrit.client.changes.PatchSetPublishDetail r , final com.google.gwt.user.client.ui.Panel body ) { for ( final com.google.gerrit.client.data.ApprovalType ct : com.google.gerrit.client.rpc.Common.getGerritConfig ( ) . getApprovalTypes ( ) . getApprovalTypes ( ) ) { if ( r.isAllowed ( ct.getCategory ( ) . getId ( ) ) ) { initApprovalType ( r , body , ct ) ; } } }

Target:
private void initApprovals ( final com.google.gerrit.client.changes.PatchSetPublishDetail r , final com.google.gwt.user.client.ui.Panel body ) { for ( final com.google.gerrit.client.data.ApprovalType ct : com.google.gerrit.client.Gerrit.getConfig ( ) . getApprovalTypes ( ) . getApprovalTypes ( ) ) { if ( r.isAllowed ( ct.getCategory ( ) . getId ( ) ) ) { initApprovalType ( r , body , ct ) ; } } }
Source:
public void abandonReviewableChangeNotifyNoneCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; abandon ( sc.changeId , sc.owner , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS , com.google.gerrit.extensions.api.changes.NotifyHandling.NONE ) ; assertThat ( sender ) . notSent ( ) ; }

Target:
public void abandonReviewableWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableWipChange ( ) ; abandon ( sc.changeId , sc.owner ) ; assertThat ( sender ) . sent ( "abandon" , sc ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) . noOneElse ( ) ; }
Source:
public void dryRunMerge ( ) throws java.lang.Exception { changeInTwoBranches ( "a.txt" , "b.txt" ) ; com.google.gerrit.acceptance.RestResponse r = adminRestSession.get ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches/master/mergeable?source=branchA" ) ) ; com.google.gerrit.extensions.common.MergeableInfo m = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.MergeableInfo.class ) ; com.google.common.truth.Truth.assertThat ( m.mergeable ) . isTrue ( ) ; }

Target:
public void createMergeChange_Conflicts_Ours ( ) throws java.lang.Exception { changeInTwoBranches ( "branchA" , "shared.txt" , "branchB" , "shared.txt" ) ; com.google.gerrit.extensions.common.ChangeInput in = newMergeChangeInput ( "branchA" , "branchB" , "ours" ) ; assertCreateSucceeds ( in ) ; }
Source:
public void testTransitionToUnhealthy ( ) throws java.io.IOException { assertIsHealthy ( ) ; javax.servlet.http.HttpServletResponse responseMock = mock ( javax.servlet.http.HttpServletResponse.class ) ; servlet.doDelete ( null , responseMock ) ; org.mockito.Mockito.verify ( responseMock ) . setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; assertIsUnhealthy ( ) ; responseMock = mock ( javax.servlet.http.HttpServletResponse.class ) ; servlet.doDelete ( null , responseMock ) ; org.mockito.Mockito.verify ( responseMock ) . setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; assertIsUnhealthy ( ) ; }

Target:
public void testTransitionToHealthyByNonAdmins ( ) throws java.io.IOException { servlet.doDelete ( null , org.mockito.Mockito.mock ( javax.servlet.http.HttpServletResponse.class ) ) ; assertIsUnhealthy ( ) ; org.mockito.Mockito.when ( capabilityControlMock.canAdministrateServer ( ) ) . thenReturn ( false ) ; javax.servlet.http.HttpServletResponse responseMock = org.mockito.Mockito.mock ( javax.servlet.http.HttpServletResponse.class ) ; servlet.doPost ( null , responseMock ) ; org.mockito.Mockito.verify ( responseMock ) . sendError ( javax.servlet.http.HttpServletResponse.SC_FORBIDDEN ) ; assertIsUnhealthy ( ) ; }
Source:
public com.google.gerrit.extensions.common.ChangeInfo get ( java.util.EnumSet < com.google.gerrit.extensions.common.ListChangesOption > s ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return new com.google.gerrit.server.api.changes.ChangeInfoMapper ( s ) . map ( changeJson.addOptions ( s ) . format ( change ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve change" , e ) ; } }

Target:
public com.google.gerrit.extensions.common.ChangeInfo get ( java.util.EnumSet < com.google.gerrit.extensions.common.ListChangesOption > s ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return ChangeInfoMapper.INSTANCE.apply ( changeJson.addOptions ( s ) . format ( change ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve change" , e ) ; } }
Source:
public java.lang.String createLinkForWebui ( java.lang.String url , java.lang.String text ) { return ( ( url + " (" ) + text ) + ")" ; }

Target:
public java.lang.String createLinkForWebui ( java.lang.String url , java.lang.String text ) { java.lang.String ret = url ; if ( ( text != null ) && ( ! ( text.equals ( url ) ) ) ) { ret += ( " (" + text ) + ")" ; } return ret ; }
Source:
public com.google.gerrit.common.data.GroupReference getValue ( ) { java.lang.String name = suggestBox.getText ( ) ; if ( ( name != null ) && ( ! ( name.isEmpty ( ) ) ) ) { return new com.google.gerrit.common.data.GroupReference ( oracle.getUUID ( name ) , name ) ; } else { return null ; } }

Target:
public void setAccessKey ( char key ) { suggestBox.setAccessKey ( key ) ; }
Source:
public void naturalSort ( ) { com.google.gerrit.server.notedb.rebuild.Event e1 = new com.google.gerrit.server.notedb.rebuild.EventSorterTest.TestEvent ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; com.google.gerrit.server.notedb.rebuild.Event e2 = new com.google.gerrit.server.notedb.rebuild.EventSorterTest.TestEvent ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; com.google.gerrit.server.notedb.rebuild.Event e3 = new com.google.gerrit.server.notedb.rebuild.EventSorterTest.TestEvent ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; java.util.List < com.google.gerrit.server.notedb.rebuild.Event > events = events ( e2 , e1 , e3 ) ; new com.google.gerrit.server.notedb.rebuild.EventSorter ( events ) . sort ( ) ; com.google.common.truth.Truth.assertThat ( events ) . containsExactly ( e1 , e2 , e3 ) . inOrder ( ) ; }

Target:
public void naturalSort ( ) { com.google.gerrit.server.notedb.rebuild.Event e1 = new com.google.gerrit.server.notedb.rebuild.EventSorterTest.TestEvent ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; com.google.gerrit.server.notedb.rebuild.Event e2 = new com.google.gerrit.server.notedb.rebuild.EventSorterTest.TestEvent ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; com.google.gerrit.server.notedb.rebuild.Event e3 = new com.google.gerrit.server.notedb.rebuild.EventSorterTest.TestEvent ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; for ( java.util.List < com.google.gerrit.server.notedb.rebuild.Event > events : com.google.common.collect.Collections2.permutations ( com.google.gerrit.server.notedb.rebuild.EventSorterTest.events ( e1 , e2 , e3 ) ) ) { com.google.gerrit.server.notedb.rebuild.EventSorterTest.assertSorted ( events , com.google.gerrit.server.notedb.rebuild.EventSorterTest.events ( e1 , e2 , e3 ) ) ; } }
Source:
protected void remove ( java.util.Set < com.google.gerrit.reviewdb.client.AccountProjectWatch.Key > ids ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.common.data.AccountProjectWatchInfo k = getRowItem ( row ) ; if ( ( k != null ) && ( ids.contains ( k.getWatch ( ) . getKey ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }

Target:
protected void remove ( java.util.Set < com.google.gerrit.client.account.ProjectWatchInfo > infos ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.client.account.ProjectWatchInfo k = getRowItem ( row ) ; if ( ( k != null ) && ( infos.contains ( k ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }
Source:
public void put ( final K key , V val ) { final com.google.gerrit.server.cache.h2.H2CacheImpl.ValueHolder < V > h = new com.google.gerrit.server.cache.h2.H2CacheImpl.ValueHolder < > ( val ) ; h.created = com.google.gerrit.server.util.TimeUtil.nowMs ( ) ; mem.put ( key , h ) ; executor.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { store.put ( key , h ) ; } } ) ; }

Target:
public void put ( final K key , V val ) { final com.google.gerrit.server.cache.h2.H2CacheImpl.ValueHolder < V > h = new com.google.gerrit.server.cache.h2.H2CacheImpl.ValueHolder < > ( val ) ; h.created = com.google.gerrit.common.TimeUtil.nowMs ( ) ; mem.put ( key , h ) ; executor.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { store.put ( key , h ) ; } } ) ; }
Source:
protected void configureServlets ( ) { serve ( "/static/*" ) . with ( com.google.gerrit.httpd.raw.StaticServlet.class ) ; install ( new com.google.gerrit.server.cache.CacheModule ( ) { @ java.lang.Override protected void configure ( ) { cache ( com.google.gerrit.httpd.raw.StaticModule.CACHE , java.nio.file.Path.class , com.google.gerrit.httpd.raw.ResourceServlet.Resource.class ) . maximumWeight ( ( 1 << 20 ) ) . weigher ( ResourceServlet.Weigher.class ) ; } } ) ; }

Target:
protected void configureServlets ( ) { serve ( "/static/*" ) . with ( com.google.gerrit.httpd.raw.SiteStaticDirectoryServlet.class ) ; install ( new com.google.gerrit.server.cache.CacheModule ( ) { @ java.lang.Override protected void configure ( ) { cache ( com.google.gerrit.httpd.raw.StaticModule.CACHE , java.nio.file.Path.class , com.google.gerrit.httpd.raw.ResourceServlet.Resource.class ) . maximumWeight ( ( 1 << 20 ) ) . weigher ( ResourceServlet.Weigher.class ) ; } } ) ; }
Source:
private void showHeader ( boolean show ) { com.google.gwt.user.client.ui.UIObject.setVisible ( patchSetNavRow , show ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( diffHeaderRow , ( show && ( header ) ) ) ; if ( show ) { parent.header.removeStyleName ( com.google.gerrit.client.diff.DiffTable.style.fullscreen ( ) ) ; } else { parent.header.addStyleName ( com.google.gerrit.client.diff.DiffTable.style.fullscreen ( ) ) ; } parent.resizeCodeMirror ( ) ; }

Target:
void setHeaderVisible ( boolean show ) { if ( show != ( com.google.gwt.user.client.ui.UIObject.isVisible ( patchSetNavRow ) ) ) { com.google.gwt.user.client.ui.UIObject.setVisible ( patchSetNavRow , show ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( diffHeaderRow , ( show && ( header ) ) ) ; if ( show ) { parent.header.removeStyleName ( com.google.gerrit.client.diff.DiffTable.style.fullscreen ( ) ) ; } else { parent.header.addStyleName ( com.google.gerrit.client.diff.DiffTable.style.fullscreen ( ) ) ; } parent.resizeCodeMirror ( ) ; } }
Source:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.server.git.WorkQueue workQueueMock = org.mockito.Mockito.mock ( com.google.gerrit.server.git.WorkQueue.class ) ; org.mockito.Mockito.when ( workQueueMock.createQueue ( 4 , "Sync stream events [SyncEvents plugin]" ) ) . thenReturn ( executorMock ) ; com.ericsson.gerrit.plugins.syncevents.Configuration configMock = org.mockito.Mockito.mock ( com.ericsson.gerrit.plugins.syncevents.Configuration.class ) ; org.mockito.Mockito.when ( configMock.getThreadPoolSize ( ) ) . thenReturn ( 4 ) ; syncEventsExecutorProvider = new com.ericsson.gerrit.plugins.syncevents.SyncEventExecutorProvider ( workQueueMock , "SyncEvents" , configMock ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.server.git.WorkQueue workQueueMock = org.mockito.Mockito.mock ( com.google.gerrit.server.git.WorkQueue.class ) ; org.mockito.Mockito.when ( workQueueMock.createQueue ( 4 , "Forward-stream-event" ) ) . thenReturn ( executorMock ) ; com.ericsson.gerrit.plugins.highavailability.Configuration configMock = org.mockito.Mockito.mock ( com.ericsson.gerrit.plugins.highavailability.Configuration.class ) ; org.mockito.Mockito.when ( configMock.getEventThreadPoolSize ( ) ) . thenReturn ( 4 ) ; eventsExecutorProvider = new com.ericsson.gerrit.plugins.highavailability.event.EventExecutorProvider ( workQueueMock , configMock ) ; }
Source:
public static boolean isExpected ( int statusCode ) { switch ( statusCode ) { case com.google.gerrit.client.rpc.RestApi.SC_UNAVAILABLE : case 400 : case 401 : case 403 : case 404 : case 405 : case 409 : case 412 : case 422 : case 429 : return true ; default : return false ; } }

Target:
public static boolean isExpected ( int statusCode ) { switch ( statusCode ) { case com.google.gerrit.client.rpc.RestApi.SC_UNAVAILABLE : case com.google.gwt.http.client.Response.SC_BAD_REQUEST : case com.google.gwt.http.client.Response.SC_UNAUTHORIZED : case com.google.gwt.http.client.Response.SC_FORBIDDEN : case com.google.gwt.http.client.Response.SC_NOT_FOUND : case com.google.gwt.http.client.Response.SC_METHOD_NOT_ALLOWED : case com.google.gwt.http.client.Response.SC_CONFLICT : case com.google.gwt.http.client.Response.SC_PRECONDITION_FAILED : case 422 : case 429 : return true ; default : return false ; } }
Source:
private static java.lang.String describe ( com.google.gerrit.server.CurrentUser user ) { if ( user instanceof com.google.gerrit.server.IdentifiedUser ) { return ( ( com.google.gerrit.server.IdentifiedUser ) ( user ) ) . getAccountId ( ) . toString ( ) ; } if ( user instanceof com.google.gerrit.server.query.change.SingleGroupUser ) { return "group:" + ( ( ( com.google.gerrit.server.query.change.SingleGroupUser ) ( user ) ) . getEffectiveGroups ( ) . getKnownGroups ( ) . iterator ( ) . next ( ) . toString ( ) ) ; } return user.toString ( ) ; }

Target:
private static java.lang.String describe ( com.google.gerrit.server.CurrentUser user ) { if ( user.isIdentifiedUser ( ) ) { return ( ( com.google.gerrit.server.IdentifiedUser ) ( user ) ) . getAccountId ( ) . toString ( ) ; } if ( user instanceof com.google.gerrit.server.query.change.SingleGroupUser ) { return "group:" + ( ( ( com.google.gerrit.server.query.change.SingleGroupUser ) ( user ) ) . getEffectiveGroups ( ) . getKnownGroups ( ) . iterator ( ) . next ( ) . toString ( ) ) ; } return user.toString ( ) ; }
Source:
void setRoot ( org.commonmark.node.Node doc ) { outline = new java.util.ArrayList < > ( ) ; com.google.common.collect.Multimap < java.lang.String , com.google.gitiles.doc.TocFormatter.TocEntry > entries = com.google.common.collect.ArrayListMultimap.create ( 16 , 4 ) ; scan ( doc , entries , new java.util.ArrayDeque < org.commonmark.node.Heading > ( ) ) ; ids = generateIds ( entries ) ; }

Target:
void setRoot ( org.commonmark.node.Node doc ) { outline = new java.util.ArrayList < > ( ) ; com.google.common.collect.ListMultimap < java.lang.String , com.google.gitiles.doc.TocFormatter.TocEntry > entries = com.google.common.collect.MultimapBuilder.hashKeys ( 16 ) . arrayListValues ( 4 ) . build ( ) ; scan ( doc , entries , new java.util.ArrayDeque < org.commonmark.node.Heading > ( ) ) ; ids = generateIds ( entries ) ; }
Source:
public void testInsertOneException ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchException ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , new java.sql.BatchUpdateException ( ) ) ; try { createClassUnderTest ( ) . insert ( com.google.gwtorm.jdbc.TestJdbcAccess.ONE_ROW ) ; org.junit.Assert.fail ( "missingException" ) ; } catch ( com.google.gwtorm.client.OrmException e ) { } }

Target:
public void testInsertOneDBException ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.SQLException exception = new java.sql.BatchUpdateException ( ) ; java.sql.PreparedStatement insert = stubStatementThrowExceptionOnExecute ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , exception ) ; com.google.gwtorm.jdbc.JdbcAccess < com.google.gwtorm.jdbc.TestJdbcAccess.Data , com.google.gwtorm.jdbc.TestJdbcAccess.Data.DataKey > classUnderTest = createClassUnderTest ( ) ; try { classUnderTest.insert ( oneRow ) ; org.junit.Assert.fail ( "missingException" ) ; } catch ( com.google.gwtorm.server.OrmException e ) { org.junit.Assert.assertSame ( e.getCause ( ) , exception ) ; } com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( insert ) ; }
Source:
public static synchronized java.io.File createTempDirectory ( ) throws java.io.IOException { java.io.File tmp = java.io.File.createTempFile ( "gerrit_test_" , "" ) . getCanonicalFile ( ) ; if ( ( ! ( tmp.delete ( ) ) ) || ( ! ( tmp.mkdir ( ) ) ) ) { throw new java.io.IOException ( ( "Cannot create " + ( tmp.getPath ( ) ) ) ) ; } com.google.gerrit.testutil.TempFileUtil.allDirsCreated.add ( tmp ) ; return tmp ; }

Target:
public static synchronized java.io.File createTempDirectory ( ) throws java.io.IOException { java.io.File tmp = java.io.File.createTempFile ( "gerrit_test_" , "" ) . getCanonicalFile ( ) ; if ( ( ! ( tmp.delete ( ) ) ) || ( ! ( tmp.mkdir ( ) ) ) ) { throw new java.io.IOException ( ( "Cannot create " + ( tmp.getPath ( ) ) ) ) ; } com.google.gerrit.testing.TempFileUtil.allDirsCreated.add ( tmp ) ; return tmp ; }
Source:
private java.lang.String getStyleForLabel ( com.google.gerrit.client.changes.ChangeInfo.LabelInfo label ) { switch ( label.status ( ) ) { case OK : return style.label_ok ( ) ; case NEED : return style.label_need ( ) ; case REJECT : case IMPOSSIBLE : return style.label_reject ( ) ; default : case MAY : return style.label_may ( ) ; } }

Target:
private java.lang.String getStyleForLabel ( com.google.gerrit.client.info.ChangeInfo.LabelInfo label ) { switch ( label.status ( ) ) { case OK : return style.label_ok ( ) ; case NEED : return style.label_need ( ) ; case REJECT : case IMPOSSIBLE : return style.label_reject ( ) ; default : case MAY : return style.label_may ( ) ; } }
Source:
public void doFilter ( com.google.gerrit.server.events.ChangeAbandonedEvent hook ) throws java.io.IOException { if ( ! ( gerritConfig.getBoolean ( its.name ( ) , null , "commentOnChangeAbandoned" , true ) ) ) { return ; } java.lang.String comment = getComment ( hook ) ; addComment ( hook.change , comment ) ; }

Target:
public void doFilter ( com.google.gerrit.server.events.ChangeAbandonedEvent hook ) throws java.io.IOException { if ( ! ( gerritConfig.getBoolean ( pluginName , null , "commentOnChangeAbandoned" , true ) ) ) { return ; } java.lang.String comment = getComment ( hook ) ; addComment ( hook.change , comment ) ; }
Source:
protected void configure ( ) { issueExtractor = createMock ( com.googlesource.gerrit.plugins.hooks.util.IssueExtractor.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.util.IssueExtractor.class ) . toInstance ( issueExtractor ) ; propertyAttributeExtractor = createMock ( com.googlesource.gerrit.plugins.hooks.util.PropertyAttributeExtractor.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.util.PropertyAttributeExtractor.class ) . toInstance ( propertyAttributeExtractor ) ; propertyFactory = createMock ( Property.Factory.class ) ; bind ( Property.Factory.class ) . toInstance ( propertyFactory ) ; }

Target:
protected void configure ( ) { bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.PluginName.class ) . toInstance ( "ItsTestName" ) ; issueExtractor = createMock ( com.googlesource.gerrit.plugins.hooks.util.IssueExtractor.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.util.IssueExtractor.class ) . toInstance ( issueExtractor ) ; propertyAttributeExtractor = createMock ( com.googlesource.gerrit.plugins.hooks.util.PropertyAttributeExtractor.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.util.PropertyAttributeExtractor.class ) . toInstance ( propertyAttributeExtractor ) ; propertyFactory = createMock ( Property.Factory.class ) ; bind ( Property.Factory.class ) . toInstance ( propertyFactory ) ; }
Source:
protected void migrateData ( com.google.gerrit.reviewdb.ReviewDb db ) throws java.sql.SQLException { if ( ( ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) . getDialect ( ) ) instanceof com.google.gwtorm.schema.sql.DialectMySQL ) { java.sql.Statement stmt = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) . getConnection ( ) . createStatement ( ) ; try { stmt.execute ( ( "ALTER TABLE account_group_members_audit" + " MODIFY removed_on TIMESTAMP NULL DEFAULT NULL" ) ) ; stmt.execute ( ( "UPDATE account_group_members_audit" + ( " SET removed_on = NULL" + " WHERE removed_by IS NULL;" ) ) ) ; } finally { stmt.close ( ) ; } } }

Target:
protected void migrateData ( com.google.gerrit.reviewdb.ReviewDb db , com.google.gerrit.server.schema.UpdateUI ui ) throws java.sql.SQLException { if ( ( ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) . getDialect ( ) ) instanceof com.google.gwtorm.schema.sql.DialectMySQL ) { java.sql.Statement stmt = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) . getConnection ( ) . createStatement ( ) ; try { stmt.execute ( ( "ALTER TABLE account_group_members_audit" + " MODIFY removed_on TIMESTAMP NULL DEFAULT NULL" ) ) ; stmt.execute ( ( "UPDATE account_group_members_audit" + ( " SET removed_on = NULL" + " WHERE removed_by IS NULL;" ) ) ) ; } finally { stmt.close ( ) ; } } }
Source:
public void initConfig ( com.google.gerrit.pgm.init.Section databaseSection ) { databaseSection.string ( "Driver class name" , "driver" , null ) ; databaseSection.string ( "URL" , "url" , null ) ; databaseSection.string ( "Database username" , "username" , com.google.gerrit.pgm.init.InitUtil.username ( ) ) ; databaseSection.password ( "username" , "password" ) ; }

Target:
public void initConfig ( com.google.gerrit.pgm.init.Section database ) { database.string ( "URL" , "url" , null ) ; guessDriver ( database ) ; database.string ( "Driver class name" , "driver" , null ) ; database.string ( "Database username" , "username" , com.google.gerrit.pgm.init.InitUtil.username ( ) ) ; database.password ( "username" , "password" ) ; }
Source:
public void testUnblockInLocalVisibilityByRegisteredUsers_Fails ( ) { grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.REGISTERED , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.REGISTERED ) ; assertFalse ( "u can't read" , u.controlForRef ( "refs/heads/master" ) . isVisibleByRegisteredUsers ( ) ) ; }

Target:
public void testUnblockInLocalVisibilityByRegisteredUsers_Fails ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.REGISTERED , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.REGISTERED ) ; assertFalse ( "u can't read" , u.controlForRef ( "refs/heads/master" ) . isVisibleByRegisteredUsers ( ) ) ; }
Source:
public com.google.gerrit.reviewdb.PatchSetInfo createValue ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.google.gerrit.reviewdb.PatchSet.Id patchSetId = com.google.gerrit.rules.StoredValues.PATCH_SET_ID.get ( engine ) ; com.google.gerrit.rules.PrologEnvironment env = ( ( com.google.gerrit.rules.PrologEnvironment ) ( engine.control ) ) ; com.google.gerrit.server.patch.PatchSetInfoFactory patchInfoFactory = env.getInjector ( ) . getInstance ( com.google.gerrit.server.patch.PatchSetInfoFactory.class ) ; try { return patchInfoFactory.get ( patchSetId ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e ) { throw new com.googlecode.prolog_cafe.lang.SystemException ( e.getMessage ( ) ) ; } }

Target:
public com.google.gerrit.reviewdb.PatchSetInfo createValue ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.google.gerrit.reviewdb.PatchSet.Id patchSetId = com.google.gerrit.rules.StoredValues.PATCH_SET_ID.get ( engine ) ; com.google.gerrit.rules.PrologEnvironment env = ( ( com.google.gerrit.rules.PrologEnvironment ) ( engine.control ) ) ; com.google.gerrit.server.patch.PatchSetInfoFactory patchInfoFactory = env.getInjector ( ) . getInstance ( com.google.gerrit.server.patch.PatchSetInfoFactory.class ) ; try { return patchInfoFactory.get ( com.google.gerrit.rules.StoredValues.REVIEW_DB.get ( engine ) , patchSetId ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e ) { throw new com.googlecode.prolog_cafe.lang.SystemException ( e.getMessage ( ) ) ; } }
Source:
private void deleteDraft ( java.lang.String changeId , java.lang.String revId , java.lang.String uuid ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = userSession.delete ( ( ( ( ( ( "/changes/" + changeId ) + "/revisions/" ) + revId ) + "/drafts/" ) + uuid ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_NO_CONTENT ) ; }

Target:
private java.util.Map < java.lang.String , java.util.List < com.google.gerrit.extensions.common.CommentInfo > > getPublishedComments ( java.lang.String changeId , java.lang.String revId ) throws java.lang.Exception { return gApi.changes ( ) . id ( changeId ) . revision ( revId ) . comments ( ) ; }
Source:
public synchronized void deleteAllProjectWatches ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { }

Target:
public synchronized void deleteAllProjectWatches ( com.google.gerrit.reviewdb.client.Account.Id accountId ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.account.WatchConfig watchConfig = read ( accountId ) ; boolean commit = false ; if ( ! ( watchConfig.getProjectWatches ( ) . isEmpty ( ) ) ) { watchConfig.getProjectWatches ( ) . clear ( ) ; commit = true ; } if ( commit ) { commit ( watchConfig ) ; } }
Source:
public boolean equals ( java.lang.Object o ) { if ( o instanceof com.google.gerrit.server.patch.DiffSummaryKey ) { com.google.gerrit.server.patch.DiffSummaryKey k = ( ( com.google.gerrit.server.patch.DiffSummaryKey ) ( o ) ) ; return ( ( ( java.util.Objects.equals ( oldId , k.oldId ) ) && ( java.util.Objects.equals ( parentNum , k.parentNum ) ) ) && ( java.util.Objects.equals ( newId , k.newId ) ) ) && ( ( whitespace ) == ( k.whitespace ) ) ; } return false ; }

Target:
public boolean equals ( java.lang.Object o ) { if ( o instanceof com.google.gerrit.server.diff.DiffSummaryKey ) { com.google.gerrit.server.diff.DiffSummaryKey k = ( ( com.google.gerrit.server.diff.DiffSummaryKey ) ( o ) ) ; return ( ( ( java.util.Objects.equals ( oldId , k.oldId ) ) && ( java.util.Objects.equals ( parentNum , k.parentNum ) ) ) && ( java.util.Objects.equals ( newId , k.newId ) ) ) && ( ( whitespace ) == ( k.whitespace ) ) ; } return false ; }
Source:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo info ) { info.revisions ( ) . copyKeysIntoChildren ( "name" ) ; com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeInfo.RevisionInfo > list = info.revisions ( ) . values ( ) ; com.google.gerrit.client.changes.ChangeInfo.RevisionInfo.sortRevisionInfoByNumber ( list ) ; diffTable.setUpPatchSetNav ( list , diff ) ; header.setChangeInfo ( info ) ; }

Target:
public void run ( ) { ( header.hasPrev ( ) ? header.prev : header.up ) . go ( ) ; }
Source:
public static java.lang.String toLongString ( final com.google.gerrit.client.reviewdb.Project.SubmitType type ) { if ( type == null ) { return "" ; } switch ( type ) { case FAST_FORWARD_ONLY : return com.google.gerrit.client.admin.Util.C.projectSubmitType_FAST_FORWARD_ONLY ( ) ; case MERGE_IF_NECESSARY : return com.google.gerrit.client.admin.Util.C.projectSubmitType_MERGE_IF_NECESSARY ( ) ; case MERGE_ALWAYS : return com.google.gerrit.client.admin.Util.C.projectSubmitType_MERGE_ALWAYS ( ) ; default : return type.name ( ) ; } }

Target:
public static java.lang.String toLongString ( final com.google.gerrit.client.reviewdb.Project.SubmitType type ) { if ( type == null ) { return "" ; } switch ( type ) { case FAST_FORWARD_ONLY : return com.google.gerrit.client.admin.Util.C.projectSubmitType_FAST_FORWARD_ONLY ( ) ; case MERGE_IF_NECESSARY : return com.google.gerrit.client.admin.Util.C.projectSubmitType_MERGE_IF_NECESSARY ( ) ; case MERGE_ALWAYS : return com.google.gerrit.client.admin.Util.C.projectSubmitType_MERGE_ALWAYS ( ) ; case CHERRY_PICK : return com.google.gerrit.client.admin.Util.C.projectSubmitType_CHERRY_PICK ( ) ; default : return type.name ( ) ; } }
Source:
private static void linkCause ( final java.sql.SQLException e ) { if ( ( ( e.getCause ( ) ) == null ) && ( ( e.getNextException ( ) ) != null ) ) { e.initCause ( e.getNextException ( ) ) ; } }

Target:
private com.google.gwtorm.client.OrmException convertError ( final java.lang.String op , final java.sql.SQLException err ) { if ( ( ( err.getCause ( ) ) == null ) && ( ( err.getNextException ( ) ) != null ) ) { err.initCause ( err.getNextException ( ) ) ; } return schema.getDialect ( ) . convertError ( op , getRelationName ( ) , err ) ; }
Source:
public void testUnblockForce ( ) { com.google.gerrit.common.data.PermissionRule r = grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) ; r.setBlock ( ) ; r.setForce ( true ) ; grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertTrue ( "u can force push" , u.controlForRef ( "refs/heads/master" ) . canForceUpdate ( ) ) ; }

Target:
public void testUnblockNoForce ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertTrue ( "u can push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }
Source:
private java.util.Properties createContextProperties ( ) { final java.util.Properties env = new java.util.Properties ( ) ; env.put ( javax.naming.Context.INITIAL_CONTEXT_FACTORY , LdapRealm.LDAP ) ; env.put ( javax.naming.Context.PROVIDER_URL , server ) ; if ( ( server.startsWith ( "ldaps:" ) ) && ( ! ( sslVerify ) ) ) { java.lang.Class < ? extends javax.net.ssl.SSLSocketFactory > factory = com.google.gerrit.util.ssl.BlindSSLSocketFactory.class ; env.put ( "java.naming.ldap.factory.socket" , factory.getName ( ) ) ; } return env ; }

Target:
private java.util.Properties createContextProperties ( ) { final java.util.Properties env = new java.util.Properties ( ) ; env.put ( javax.naming.Context.INITIAL_CONTEXT_FACTORY , LdapRealm.LDAP ) ; env.put ( javax.naming.Context.PROVIDER_URL , server ) ; if ( ( server.startsWith ( "ldaps:" ) ) && ( ! ( sslVerify ) ) ) { java.lang.Class < ? extends javax.net.ssl.SSLSocketFactory > factory = com.google.gerrit.util.ssl.BlindSSLSocketFactory.class ; env.put ( "java.naming.ldap.factory.socket" , factory.getName ( ) ) ; } if ( ( readTimeOutMillis ) != null ) { env.put ( "com.sun.jndi.ldap.read.timeout" , readTimeOutMillis ) ; } return env ; }
Source:
void initMeter ( ) { if ( ( ( stage ) == 0 ) && ( ( meter ) == null ) ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; b.openTr ( ) ; b.openTd ( ) ; b.closeTd ( ) ; b.closeTr ( ) ; resetHtml ( b ) ; meter = new com.google.gwtexpui.progress.client.ProgressBar ( Util.M.loadingPatchSet ( psid.get ( ) ) ) ; table.setWidget ( 0 , 0 , meter ) ; } updateMeter ( ) ; }

Target:
void initMeter ( ) { if ( ( meter ) == null ) { meter = new com.google.gwtexpui.progress.client.ProgressBar ( Util.M.loadingPatchSet ( psid.get ( ) ) ) ; myBody.clear ( ) ; myBody.add ( meter ) ; } updateMeter ( ) ; }
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 getLine ( com.google.gerrit.server.patch.PatchFile fileInfo , short side , int lineNbr ) { try { return fileInfo.getLine ( side , lineNbr ) ; } catch ( java.io.IOException err ) { com.google.gerrit.server.mail.CommentSender.log.warn ( java.lang.String.format ( "Failed to read file on side %d" , side ) , err ) ; return "" ; } catch ( java.lang.IndexOutOfBoundsException err ) { com.google.gerrit.server.mail.CommentSender.log.warn ( java.lang.String.format ( "Failed to get line number of file on side %d" , side ) , err ) ; return "" ; } catch ( com.google.gerrit.common.errors.NoSuchEntityException err ) { com.google.gerrit.server.mail.CommentSender.log.warn ( java.lang.String.format ( "Side %d of file didn't exist" , side ) , err ) ; return "" ; } }
Source:
public void testCreate_NotExisting ( ) throws java.io.IOException { final java.io.File root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; org.junit.Assert.assertTrue ( site.isNew ) ; org.junit.Assert.assertEquals ( root , site.site_path ) ; org.junit.Assert.assertEquals ( new java.io.File ( root , "etc" ) , site.etc_dir ) ; }

Target:
public void testCreate_NotExisting ( ) throws java.io.IOException { final java.nio.file.Path root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; org.junit.Assert.assertTrue ( site.isNew ) ; org.junit.Assert.assertEquals ( root.toFile ( ) , site.site_path ) ; org.junit.Assert.assertEquals ( root.resolve ( "etc" ) . toFile ( ) , site.etc_dir ) ; }
Source:
protected void configure ( ) { install ( new com.google.gerrit.server.config.FactoryModule ( ) { @ java.lang.Override public void configure ( ) { factory ( LuceneChangeIndex.Factory.class ) ; } } ) ; install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; if ( ( singleVersion ) == null ) { listener ( ) . to ( com.google.gerrit.lucene.LuceneVersionManager.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; } else { install ( new com.google.gerrit.lucene.LuceneIndexModule.SingleVersionModule ( ) ) ; } }

Target:
public void configure ( ) { install ( new com.google.gerrit.server.config.FactoryModule ( ) { @ java.lang.Override public void configure ( ) { factory ( OnlineReindexer.Factory.class ) ; } } ) ; listener ( ) . to ( com.google.gerrit.lucene.LuceneVersionManager.class ) ; }
Source:
public void testIsEnabledRefParentNoBranchDisabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { } ; setupIsEnabled ( "false" , "false" , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectNK = new com.google.gerrit.reviewdb.client.Project.NameKey ( "testProject" ) ; assertFalse ( itsConfig.isEnabled ( projectNK , "refs/heads/testBranch" ) ) ; }

Target:
public void BROKEN_testIsEnabledRefParentNoBranchDisabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { } ; setupIsEnabled ( "false" , "false" , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectNK = new com.google.gerrit.reviewdb.client.Project.NameKey ( "testProject" ) ; assertFalse ( itsConfig.isEnabled ( projectNK , "refs/heads/testBranch" ) ) ; }
Source:
public com.google.common.base.Optional < org.eclipse.jgit.lib.ObjectId > get ( java.lang.String refName ) throws java.io.IOException { com.google.common.base.Optional < org.eclipse.jgit.lib.ObjectId > id = ids.get ( refName ) ; if ( id != null ) { return id ; } org.eclipse.jgit.lib.Ref ref = refdb.exactRef ( refName ) ; id = ( ref != null ) ? com.google.common.base.Optional.of ( ref.getObjectId ( ) ) : com.google.common.base.Optional.< org.eclipse.jgit.lib.ObjectId > absent ( ) ; ids.put ( refName , id ) ; return id ; }

Target:
public java.util.Optional < org.eclipse.jgit.lib.ObjectId > get ( java.lang.String refName ) throws java.io.IOException { java.util.Optional < org.eclipse.jgit.lib.ObjectId > id = ids.get ( refName ) ; if ( id != null ) { return id ; } org.eclipse.jgit.lib.Ref ref = refdb.exactRef ( refName ) ; id = java.util.Optional.ofNullable ( ref ) . map ( Ref :: getObjectId ) ; ids.put ( refName , id ) ; return id ; }
Source:
protected boolean xsrfValidate ( final com.google.gwtjsonrpc.server.ActiveCall call ) throws com.google.gwtjsonrpc.server.XsrfException { final javax.servlet.http.HttpServletRequest req = call.httpRequest ; final java.lang.String user = xsrfUser ( call ) ; final java.lang.String path = req.getServletPath ( ) ; call.httpResponse.addHeader ( com.google.gwtjsonrpc.client.Shared.XSRF_HEADER , xsrf.newToken ( user , path ) ) ; return xsrf.checkToken ( req.getHeader ( com.google.gwtjsonrpc.client.Shared.XSRF_HEADER ) , user , path ) ; }

Target:
protected boolean xsrfValidate ( final com.google.gwtjsonrpc.server.ActiveCall call ) throws com.google.gwtjsonrpc.server.XsrfException { final javax.servlet.http.HttpServletRequest req = call.httpRequest ; final java.lang.String user = xsrfUser ( call ) ; final java.lang.String path = req.getServletPath ( ) ; final java.lang.String userpath = ( ( ":" + user ) + ":" ) + path ; call.httpResponse.addHeader ( com.google.gwtjsonrpc.client.Shared.XSRF_HEADER , xsrf.newToken ( userpath ) ) ; return xsrf.checkToken ( req.getHeader ( com.google.gwtjsonrpc.client.Shared.XSRF_HEADER ) , userpath ) ; }
Source:
public java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > byCommitsOnBranchNotMerged ( com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.util.List < java.lang.String > hashes ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema = com.google.gerrit.server.query.change.InternalChangeQuery.schema ( indexes ) ; if ( ( schema != null ) && ( schema.hasField ( ChangeField.EXACT_COMMIT ) ) ) { return query ( com.google.gerrit.server.query.change.InternalChangeQuery.commitsOnBranchNotMerged ( branch , com.google.gerrit.server.query.change.InternalChangeQuery.commits ( schema , hashes ) ) ) ; } else { return byCommitsOnBranchNotMerged ( schema , branch , hashes , indexConfig.maxPrefixTerms ( ) ) ; } }

Target:
public java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > byCommitsOnBranchNotMerged ( com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.util.List < java.lang.String > hashes ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema = com.google.gerrit.server.query.change.InternalChangeQuery.schema ( indexes ) ; int batchSize ; if ( ( schema != null ) && ( schema.hasField ( ChangeField.EXACT_COMMIT ) ) ) { batchSize = 500 ; } else { batchSize = indexConfig.maxPrefixTerms ( ) ; } return byCommitsOnBranchNotMerged ( schema , branch , hashes , batchSize ) ; }
Source:
private static void createIndexes ( ) { com.google.gerrit.elasticsearch.ElasticChangeIndex.ChangeMapping openChangesMapping = new com.google.gerrit.elasticsearch.ElasticChangeIndex.ChangeMapping ( ChangeSchemaDefinitions.INSTANCE.getLatest ( ) ) ; com.google.gerrit.elasticsearch.ElasticChangeIndex.ChangeMapping closedChangesMapping = new com.google.gerrit.elasticsearch.ElasticChangeIndex.ChangeMapping ( ChangeSchemaDefinitions.INSTANCE.getLatest ( ) ) ; openChangesMapping.closedChanges = null ; closedChangesMapping.openChanges = null ; com.google.gerrit.elasticsearch.ElasticQueryChangesTest.node.client ( ) . admin ( ) . indices ( ) . prepareCreate ( com.google.gerrit.elasticsearch.ElasticQueryChangesTest.INDEX_NAME ) . addMapping ( com.google.gerrit.elasticsearch.ElasticChangeIndex.OPEN_CHANGES , com.google.gerrit.elasticsearch.ElasticQueryChangesTest.gson.toJson ( openChangesMapping ) ) . addMapping ( com.google.gerrit.elasticsearch.ElasticChangeIndex.CLOSED_CHANGES , com.google.gerrit.elasticsearch.ElasticQueryChangesTest.gson.toJson ( closedChangesMapping ) ) . execute ( ) . actionGet ( ) ; }

Target:
public void cleanupIndex ( ) { if ( ( com.google.gerrit.elasticsearch.ElasticQueryChangesTest.nodeInfo ) != null ) { com.google.gerrit.elasticsearch.ElasticTestUtils.deleteIndexes ( com.google.gerrit.elasticsearch.ElasticQueryChangesTest.nodeInfo.node , com.google.gerrit.elasticsearch.ElasticQueryChangesTest.INDEX_NAME ) ; com.google.gerrit.elasticsearch.ElasticQueryChangesTest.createIndexes ( ) ; } }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.plugins.StartPluginListener.class ) . annotatedWith ( com.google.inject.internal.UniqueAnnotations.create ( ) ) . to ( com.google.gerrit.sshd.SshPluginStarterCallback.class ) ; listener ( ) . to ( com.google.gerrit.sshd.SshLog.class ) ; listener ( ) . to ( com.google.gerrit.sshd.SshDaemon.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.sshd.SshPluginStarterCallback.class ) ; bind ( com.google.gerrit.server.plugins.StartPluginListener.class ) . annotatedWith ( com.google.inject.internal.UniqueAnnotations.create ( ) ) . to ( com.google.gerrit.sshd.SshPluginStarterCallback.class ) ; bind ( com.google.gerrit.server.plugins.ReloadPluginListener.class ) . annotatedWith ( com.google.inject.internal.UniqueAnnotations.create ( ) ) . to ( com.google.gerrit.sshd.SshPluginStarterCallback.class ) ; listener ( ) . to ( com.google.gerrit.sshd.SshLog.class ) ; listener ( ) . to ( com.google.gerrit.sshd.SshDaemon.class ) ; }
Source:
public void testAppend_StringBuilder ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; assertSame ( b , b.append ( ( ( java.lang.StringBuilder ) ( null ) ) ) ) ; assertEquals ( "" , b.asString ( ) ) ; assertSame ( b , b.append ( new java.lang.StringBuilder ( "foo" ) ) ) ; assertSame ( b , b.append ( new java.lang.StringBuilder ( "bar" ) ) ) ; assertEquals ( "foobar" , b.asString ( ) ) ; }

Target:
public void testAppend_StringBuffer ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.append ( ( ( java.lang.StringBuffer ) ( null ) ) ) ) ; org.junit.Assert.assertEquals ( "" , b.asString ( ) ) ; org.junit.Assert.assertSame ( b , b.append ( new java.lang.StringBuffer ( "foo" ) ) ) ; org.junit.Assert.assertSame ( b , b.append ( new java.lang.StringBuffer ( "bar" ) ) ) ; org.junit.Assert.assertEquals ( "foobar" , b.asString ( ) ) ; }
Source:
private com.google.gerrit.server.account.AuthResult bySshUserName ( final javax.servlet.http.HttpServletResponse rsp , final java.lang.String userName ) { try { final com.google.gerrit.reviewdb.ReviewDb db = schema.open ( ) ; try { return auth ( db.accounts ( ) . bySshUserName ( userName ) ) ; } finally { db.close ( ) ; } } catch ( com.google.gwtorm.client.OrmException e ) { getServletContext ( ) . log ( "cannot query database" , e ) ; return null ; } }

Target:
private com.google.gerrit.server.account.AuthResult bySshUserName ( final javax.servlet.http.HttpServletResponse rsp , final java.lang.String userName ) { try { final com.google.gerrit.reviewdb.ReviewDb db = schema.open ( ) ; try { com.google.gerrit.reviewdb.AccountExternalId.Key key = new com.google.gerrit.reviewdb.AccountExternalId.Key ( com.google.gerrit.reviewdb.AccountExternalId.SCHEME_USERNAME , userName ) ; return auth ( db.accountExternalIds ( ) . get ( key ) ) ; } finally { db.close ( ) ; } } catch ( com.google.gwtorm.client.OrmException e ) { getServletContext ( ) . log ( "cannot query database" , e ) ; return null ; } }
Source:
public void rebase ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { rebase.get ( ) . apply ( revision , null ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot rebase ps" , e ) ; } catch ( com.google.gerrit.common.errors.EmailException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot rebase ps" , e ) ; } }

Target:
public com.google.gerrit.extensions.api.changes.ChangeApi rebase ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return changes.id ( rebase.get ( ) . apply ( revision , null ) . _number ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot rebase ps" , e ) ; } catch ( com.google.gerrit.common.errors.EmailException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot rebase ps" , e ) ; } }