auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected int rowOf ( final com.google.gwt.user.client.Element target ) { final com.google.gwt.user.client.Element td = getParentCell ( target ) ; if ( td == null ) { return - 1 ; } final com.google.gwt.user.client.Element tr = com.google.gwt.user.client.DOM.getParent ( td ) ; final com.google.gwt.user.client.Element body = com.google.gwt.user.client.DOM.getParent ( tr ) ; return com.google.gwt.user.client.DOM.getChildIndex ( body , tr ) ; }

Target:
protected int rowOf ( final com.google.gwt.dom.client.Element target ) { final com.google.gwt.dom.client.Element td = getParentCell ( target ) ; if ( td == null ) { return - 1 ; } final com.google.gwt.dom.client.Element tr = com.google.gwt.user.client.DOM.getParent ( td ) ; final com.google.gwt.dom.client.Element body = com.google.gwt.user.client.DOM.getParent ( tr ) ; return com.google.gwt.user.client.DOM.getChildIndex ( body , tr ) ; }
Source:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.PrologException { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 = arg1.dereference ( ) ; com.google.gerrit.server.project.ChangeControl control = StoredValues.CHANGE_CONTROL.get ( engine ) ; com.google.gerrit.reviewdb.client.Project.SubmitType submitType = control.getProject ( ) . getSubmitType ( ) ; if ( ! ( a1.unify ( gerrit.PRED_project_default_submit_type_1.term [ submitType.ordinal ( ) ] , engine.trail ) ) ) { return engine.fail ( ) ; } return cont ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.PrologException { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 = arg1.dereference ( ) ; com.google.gerrit.server.project.ChangeControl control = StoredValues.CHANGE_CONTROL.get ( engine ) ; com.google.gerrit.extensions.common.SubmitType submitType = control.getProject ( ) . getSubmitType ( ) ; if ( ! ( a1.unify ( gerrit.PRED_project_default_submit_type_1.term [ submitType.ordinal ( ) ] , engine.trail ) ) ) { return engine.fail ( ) ; } return cont ; }
Source:
public void addWriteIndex ( com.google.gerrit.server.index.ChangeIndex index ) { int version = index.getSchema ( ) . getVersion ( ) ; com.google.common.base.Preconditions.checkState ( ( ( writeIndexes.putIfAbsent ( version , index ) ) == null ) , "Write index version %s already in map" , version ) ; }

Target:
public synchronized void addWriteIndex ( com.google.gerrit.server.index.ChangeIndex index ) { int version = index.getSchema ( ) . getVersion ( ) ; for ( com.google.gerrit.server.index.ChangeIndex i : writeIndexes ) { if ( ( i.getSchema ( ) . getVersion ( ) ) == version ) { throw new java.lang.IllegalArgumentException ( ( ( "Write index version " + version ) + " already in list" ) ) ; } } writeIndexes.add ( index ) ; }
Source:
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 ) ; }

Target:
protected com.google.gwtorm.server.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 , com.google.gwtorm.jdbc.JdbcAccess.getRelationName ( ) , err ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { dispatcherMock = org.easymock.EasyMock.createMock ( com.google.gerrit.common.EventDispatcher.class ) ; org.easymock.EasyMock.replay ( dispatcherMock ) ; com.google.gerrit.reviewdb.server.ReviewDb reviewDbMock = org.easymock.EasyMock.createNiceMock ( com.google.gerrit.reviewdb.server.ReviewDb.class ) ; org.easymock.EasyMock.replay ( reviewDbMock ) ; com.google.gwtorm.server.SchemaFactory < com.google.gerrit.reviewdb.server.ReviewDb > schemaMock = org.easymock.EasyMock.createMock ( com.google.gwtorm.server.SchemaFactory.class ) ; org.easymock.EasyMock.expect ( schemaMock.open ( ) ) . andReturn ( reviewDbMock ) . anyTimes ( ) ; org.easymock.EasyMock.replay ( schemaMock ) ; gitUpdateProcessing = new com.googlesource.gerrit.plugins.replication.PushResultProcessing.GitUpdateProcessing ( dispatcherMock ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { dispatcherMock = org.easymock.EasyMock.createMock ( com.google.gerrit.server.events.EventDispatcher.class ) ; org.easymock.EasyMock.replay ( dispatcherMock ) ; com.google.gerrit.reviewdb.server.ReviewDb reviewDbMock = org.easymock.EasyMock.createNiceMock ( com.google.gerrit.reviewdb.server.ReviewDb.class ) ; org.easymock.EasyMock.replay ( reviewDbMock ) ; com.google.gwtorm.server.SchemaFactory < com.google.gerrit.reviewdb.server.ReviewDb > schemaMock = org.easymock.EasyMock.createMock ( com.google.gwtorm.server.SchemaFactory.class ) ; org.easymock.EasyMock.expect ( schemaMock.open ( ) ) . andReturn ( reviewDbMock ) . anyTimes ( ) ; org.easymock.EasyMock.replay ( schemaMock ) ; gitUpdateProcessing = new com.googlesource.gerrit.plugins.replication.PushResultProcessing.GitUpdateProcessing ( dispatcherMock ) ; }
Source:
protected void execute ( com.google.gerrit.reviewdb.server.ReviewDb db , java.lang.String sql ) throws java.sql.SQLException { java.sql.Statement s = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) . getConnection ( ) . createStatement ( ) ; try { s.execute ( sql ) ; } finally { s.close ( ) ; } }

Target:
protected static java.sql.Statement newStatement ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws java.sql.SQLException { return ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) . getConnection ( ) . createStatement ( ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.git.GitRepositoryManager.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.pgm.util.ConsoleUI.class ) . toInstance ( ui ) ; bind ( java.io.File.class ) . annotatedWith ( com.google.gerrit.server.config.SitePath.class ) . toInstance ( sitePath ) ; bind ( com.google.gerrit.pgm.init.ReloadSiteLibrary.class ) . toInstance ( new com.google.gerrit.pgm.init.ReloadSiteLibrary ( ) { @ java.lang.Override public void reload ( ) { com.google.gerrit.pgm.Init.super . loadSiteLib ( ) ; } } ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.httpd.GerritOptions.class ) . toInstance ( new com.google.gerrit.httpd.GerritOptions ( headless , slave ) ) ; if ( test ) { bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.server.securestore.SecureStoreClassName.class ) . toInstance ( com.google.gerrit.server.securestore.DefaultSecureStore.class . getName ( ) ) ; bind ( com.google.gerrit.server.securestore.SecureStore.class ) . toProvider ( com.google.gerrit.server.securestore.SecureStoreProvider.class ) ; } }

Target:
protected void configure ( ) { bind ( com.google.gerrit.httpd.GerritOptions.class ) . toInstance ( new com.google.gerrit.httpd.GerritOptions ( config , headless , slave , polyGerritDev ) ) ; if ( test ) { bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.server.securestore.SecureStoreClassName.class ) . toInstance ( com.google.gerrit.server.securestore.DefaultSecureStore.class . getName ( ) ) ; bind ( com.google.gerrit.server.securestore.SecureStore.class ) . toProvider ( com.google.gerrit.server.securestore.SecureStoreProvider.class ) ; } }
Source:
public void testDoPostRefReplicationDoneEvent ( ) throws java.lang.Exception { java.lang.String event = "{\"project\":\"gerrit/test-sync-index\",\"ref\":" + ( "\"refs/changes/76/669676/2\",\"nodesCount\":1,\"type\":" + "\"ref-replication-done\",\"eventCreatedOn\":1451415011}" ) ; org.easymock.EasyMock.expect ( req.getReader ( ) ) . andReturn ( new java.io.BufferedReader ( new java.io.StringReader ( event ) ) ) ; dispatcher.postEvent ( org.easymock.EasyMock.isA ( com.ericsson.gerrit.plugins.syncevents.SyncEventsRestApiServletTest.RefReplicationDoneEvent.class ) ) ; rsp.setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; org.easymock.EasyMock.expectLastCall ( ) . once ( ) ; replayAll ( ) ; syncEventsRestApiServlet.doPost ( req , rsp ) ; verifyAll ( ) ; }

Target:
public void testDoPostRefReplicationDoneEvent ( ) throws java.lang.Exception { java.lang.String event = "{\"project\":\"gerrit/test-sync-index\",\"ref\":" + ( "\"refs/changes/76/669676/2\",\"nodesCount\":1,\"type\":" + "\"ref-replication-done\",\"eventCreatedOn\":1451415011}" ) ; org.mockito.Mockito.when ( req.getReader ( ) ) . thenReturn ( new java.io.BufferedReader ( new java.io.StringReader ( event ) ) ) ; dispatcher.postEvent ( org.mockito.ArgumentMatchers.any ( com.ericsson.gerrit.plugins.syncevents.SyncEventsRestApiServletTest.RefReplicationDoneEvent.class ) ) ; syncEventsRestApiServlet.doPost ( req , rsp ) ; org.mockito.Mockito.verify ( rsp ) . setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { final com.google.gerrit.common.data.GroupOptions groupOptions = new com.google.gerrit.common.data.GroupOptions ( visibleToAllCheckBox.getValue ( ) ) ; Util.GROUP_SVC.changeGroupOptions ( getGroupId ( ) , groupOptions , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.common.VoidResult > ( ) { public void onSuccess ( final com.google.gwtjsonrpc.common.VoidResult result ) { saveGroupOptions.setEnabled ( false ) ; } } ) ; }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { com.google.gerrit.client.groups.GroupApi.setGroupOptions ( getGroupUUID ( ) , visibleToAllCheckBox.getValue ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.VoidResult > ( ) { public void onSuccess ( final com.google.gerrit.client.VoidResult result ) { saveGroupOptions.setEnabled ( false ) ; } } ) ; }
Source:
public void nonexistentEmail ( ) throws java.lang.Exception { exception.expect ( com.google.gerrit.extensions.restapi.UnprocessableEntityException.class ) ; exception.expectMessage ( "cannot find account doesnotexist@invalid.com" ) ; gApi.projects ( ) . name ( normalProject.get ( ) ) . checkAccess ( new com.google.gerrit.extensions.api.config.AccessCheckInput ( "doesnotexist@invalid.com" , null ) ) ; }

Target:
public void nonexistentPermission ( ) throws java.lang.Exception { exception.expect ( com.google.gerrit.extensions.restapi.BadRequestException.class ) ; exception.expectMessage ( "not recognized" ) ; com.google.gerrit.extensions.api.config.AccessCheckInput in = new com.google.gerrit.extensions.api.config.AccessCheckInput ( ) ; in.account = user.email ; in.permission = "notapermission" ; in.ref = "refs/heads/master" ; gApi.projects ( ) . name ( normalProject.get ( ) ) . checkAccess ( in ) ; }
Source:
public com.google.gerrit.server.cache.Cache < K , V > get ( ) { if ( ( cache ) == null ) { throw new com.google.inject.ProvisionException ( ( ( "Cache \"" + ( cacheName ) ) + "\" not available" ) ) ; } return new com.google.gerrit.server.cache.SimpleCache < K , V > ( cache ) ; }

Target:
public com.google.gerrit.server.cache.Cache < K , V > get ( ) { if ( ( cache ) == null ) { throw new com.google.inject.ProvisionException ( ( ( "Cache \"" + ( cacheName ) ) + "\" not available" ) ) ; } if ( ( entryCreator ) != null ) { return new com.google.gerrit.server.cache.PopulatingCache < K , V > ( cache , entryCreator.get ( ) ) ; } return new com.google.gerrit.server.cache.SimpleCache < K , V > ( cache ) ; }
Source:
public void setSearchIndex ( com.google.gerrit.server.index.ChangeIndex index ) { com.google.gerrit.server.index.ChangeIndex old = searchIndex.getAndSet ( index ) ; if ( ( ( old != null ) && ( old != index ) ) && ( ! ( writeIndexes.contains ( old ) ) ) ) { old.close ( ) ; } }

Target:
public void setSearchIndex ( com.google.gerrit.server.index.ChangeIndex index ) { com.google.gerrit.server.index.ChangeIndex old = searchIndex.getAndSet ( index ) ; initLatch.countDown ( ) ; if ( ( ( old != null ) && ( old != index ) ) && ( ! ( writeIndexes.contains ( old ) ) ) ) { old.close ( ) ; } }
Source:
public void changeUserName ( final java.lang.String newName , final com.google.gwtjsonrpc.common.AsyncCallback < com.google.gwtjsonrpc.common.VoidResult > callback ) { if ( realm.allowsEdit ( Account.FieldName.USER_NAME ) ) { com.google.gerrit.httpd.rpc.Handler.wrap ( changeUserNameFactory.create ( newName ) ) . to ( callback ) ; } else { callback.onFailure ( new com.google.gerrit.common.errors.NameAlreadyUsedException ( ) ) ; } }

Target:
public void changeUserName ( final java.lang.String newName , final com.google.gwtjsonrpc.common.AsyncCallback < com.google.gwtjsonrpc.common.VoidResult > callback ) { if ( realm.allowsEdit ( Account.FieldName.USER_NAME ) ) { com.google.gerrit.httpd.rpc.Handler.wrap ( changeUserNameFactory.create ( newName ) ) . to ( callback ) ; } else { callback.onFailure ( new com.google.gerrit.common.errors.PermissionDeniedException ( ( "Not allowed to change" + " username" ) ) ) ; } }
Source:
public void testUpdateOneDBException ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.SQLException exception = new java.sql.BatchUpdateException ( ) ; java.sql.PreparedStatement update = stubStatementThrowExceptionOnExecute ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , exception ) ; com.google.gwtorm.jdbc.JdbcAccess < com.google.gwtorm.jdbc.TestJdbcAccess.Data , com.google.gwtorm.jdbc.TestJdbcAccess.Data.DataKey > classUnderTest = createClassUnderTest ( ) ; try { classUnderTest.update ( 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 ( update ) ; }

Target:
public void testInsertOneException ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { sqlException = new java.sql.BatchUpdateException ( ) ; java.sql.PreparedStatement insert = stubStatementThrowExceptionOnExecute ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.INSERT , sqlException ) ; try { classUnderTest.insert ( oneRow ) ; org.junit.Assert.fail ( "missingException" ) ; } catch ( com.google.gwtorm.server.OrmException e ) { org.junit.Assert.assertSame ( e.getCause ( ) , sqlException ) ; } assertCorrectUpdating ( insert , 1 ) ; }
Source:
public void onPreReceive ( final org.eclipse.jgit.transport.ReceivePack arg0 , final java.util.Collection < org.eclipse.jgit.transport.ReceiveCommand > commands ) { parseCommands ( commands ) ; if ( ( ( newChange ) != null ) && ( ( newChange.getResult ( ) ) == ( org.eclipse.jgit.transport.ReceiveCommand.Result.NOT_ATTEMPTED ) ) ) { createNewChanges ( ) ; } doReplaces ( ) ; }

Target:
public void setMessageSender ( final com.google.gerrit.server.git.ReceiveCommits.MessageSender ms ) { messageSender = ( ms != null ) ? ms : new com.google.gerrit.server.git.ReceiveCommits.ReceivePackMessageSender ( ) ; }
Source:
static com.google.gerrit.server.config.ConfigUtilTest.SectionInfo defaults ( ) { com.google.gerrit.server.config.ConfigUtilTest.SectionInfo i = new com.google.gerrit.server.config.ConfigUtilTest.SectionInfo ( ) ; i.i = 1 ; i.ii = 2 ; i.id = 3 ; i.l = 4L ; i.ll = 5L ; i.ld = 6L ; i.b = true ; i.bb = false ; i.bd = true ; i.s = "foo" ; i.sd = "bar" ; i.t = com.google.gerrit.extensions.client.Theme.DEFAULT ; i.td = com.google.gerrit.extensions.client.Theme.DEFAULT ; return i ; }

Target:
static com.google.gerrit.server.config.ConfigUtilTest.SectionInfo defaults ( ) { com.google.gerrit.server.config.ConfigUtilTest.SectionInfo i = new com.google.gerrit.server.config.ConfigUtilTest.SectionInfo ( ) ; i.i = 1 ; i.ii = 2 ; i.id = 3 ; i.l = 4L ; i.ll = 5L ; i.ld = 6L ; i.b = true ; i.bb = false ; i.bd = true ; i.s = "foo" ; i.sd = "bar" ; i.nd = null ; i.t = com.google.gerrit.extensions.client.Theme.DEFAULT ; i.td = com.google.gerrit.extensions.client.Theme.DEFAULT ; return i ; }
Source:
private void flushCache ( final java.lang.String name ) { try { getGerritServer ( ) . getCache ( name ) . removeAll ( ) ; } catch ( java.lang.Throwable e1 ) { p.println ( ( ( ( "warning: cannot flush cache \"" + name ) + "\": " ) + e1 ) ) ; } }

Target:
private void saveToDisk ( final net.sf.ehcache.Ehcache c ) { try { c.flush ( ) ; } catch ( java.lang.Throwable e ) { p.println ( ( ( ( "warning: cannot save cache \"" + ( c.getName ( ) ) ) + "\": " ) + e ) ) ; } }
Source:
public void testIssueIdsEmptyGroup ( ) { com.googlesource.gerrit.plugins.hooks.util.IssueExtractor issueExtractor = injector.getInstance ( com.googlesource.gerrit.plugins.hooks.util.IssueExtractor.class ) ; org.easymock.EasyMock.expect ( itsConfig.getIssuePattern ( ) ) . andReturn ( java.util.regex.Pattern.compile ( "bug#(X*)(\\d+)" ) ) . atLeastOnce ( ) ; replayMocks ( ) ; java.lang.String [ ] ret = issueExtractor.getIssueIds ( "bug#4711" ) ; assertEquals ( "Number of found ids do not match" , 0 , ret.length ) ; assertLogMessageContains ( "Matching" ) ; }

Target:
public void testIssueIdsEmptyGroup ( ) { com.googlesource.gerrit.plugins.hooks.util.IssueExtractor issueExtractor = injector.getInstance ( com.googlesource.gerrit.plugins.hooks.util.IssueExtractor.class ) ; org.easymock.EasyMock.expect ( itsConfig.getIssuePattern ( ) ) . andReturn ( java.util.regex.Pattern.compile ( "bug#(X*)(\\d+)" ) ) . atLeastOnce ( ) ; org.easymock.EasyMock.expect ( itsConfig.getIssuePatternGroupIndex ( ) ) . andReturn ( 1 ) . atLeastOnce ( ) ; replayMocks ( ) ; java.lang.String [ ] ret = issueExtractor.getIssueIds ( "bug#4711" ) ; assertEquals ( "Number of found ids do not match" , 0 , ret.length ) ; assertLogMessageContains ( "Matching" ) ; }
Source:
public boolean canFastForward ( final com.google.gerrit.server.git.MergeSorter mergeSorter , final com.google.gerrit.server.git.CodeReviewCommit mergeTip , final org.eclipse.jgit.revwalk.RevWalk rw , final com.google.gerrit.server.git.CodeReviewCommit toMerge ) throws com.google.gerrit.server.git.MergeException { if ( hasMissingDependencies ( mergeSorter , toMerge ) ) { return false ; } try { return ( mergeTip == null ) || ( rw.isMergedInto ( mergeTip , toMerge ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.MergeException ( "Cannot fast-forward test during merge" , e ) ; } }

Target:
public boolean canFastForward ( com.google.gerrit.server.git.MergeSorter mergeSorter , com.google.gerrit.server.git.CodeReviewCommit mergeTip , com.google.gerrit.server.git.CodeReviewCommit.CodeReviewRevWalk rw , com.google.gerrit.server.git.CodeReviewCommit toMerge ) throws com.google.gerrit.server.git.MergeException { if ( hasMissingDependencies ( mergeSorter , toMerge ) ) { return false ; } try { return ( mergeTip == null ) || ( rw.isMergedInto ( mergeTip , toMerge ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.MergeException ( "Cannot fast-forward test during merge" , e ) ; } }
Source:
public int weigh ( com.google.gerrit.server.patch.IntraLineDiffKey key , com.google.gerrit.server.patch.IntraLineDiff value ) { return ( ( ( ( ( ( ( ( 16 + ( 8 * 8 ) ) + ( 2 * 36 ) ) + 16 ) + ( 2 * 8 ) ) + 16 ) + 8 ) + 4 ) + 20 ) + ( ( ( 8 + 16 ) + ( 4 * 4 ) ) * ( value.getEdits ( ) . size ( ) ) ) ; }

Target:
public int weigh ( com.google.gerrit.server.diff.IntraLineDiffKey key , com.google.gerrit.server.diff.IntraLineDiff value ) { return ( ( ( ( ( ( ( ( 16 + ( 8 * 8 ) ) + ( 2 * 36 ) ) + 16 ) + ( 2 * 8 ) ) + 16 ) + 8 ) + 4 ) + 20 ) + ( ( ( 8 + 16 ) + ( 4 * 4 ) ) * ( value.getEdits ( ) . size ( ) ) ) ; }
Source:
int getParentNumFromDisplaySide ( com.google.gerrit.client.diff.DisplaySide side ) { if ( ( ( side == ( DisplaySide.A ) ) && ( ( base ) != null ) ) && ( ( base.get ( ) ) < 0 ) ) { return - ( base.get ( ) ) ; } return 0 ; }

Target:
PatchSet.Id getPatchSetIdFromSide ( com.google.gerrit.client.diff.DisplaySide side ) { if ( ( side == ( DisplaySide.A ) ) && ( ( base.isPatchSet ( ) ) || ( base.isEdit ( ) ) ) ) { return base.asPatchSetId ( ) ; } return revision ; }
Source:
public com.google.common.collect.ImmutableSet < com.google.gerrit.reviewdb.client.Change.Id > ids ( ) { com.google.common.collect.ImmutableSet.Builder < com.google.gerrit.reviewdb.client.Change.Id > ret = com.google.common.collect.ImmutableSet.builder ( ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : changeData ) { ret.add ( cd.getId ( ) ) ; } return ret.build ( ) ; }

Target:
public com.google.common.collect.ImmutableSet < com.google.gerrit.reviewdb.client.Change.Id > ids ( ) { return changeData.keySet ( ) ; }
Source:
public PatchSet.Id call ( ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { try { if ( ( ( magicBranch ) != null ) && ( magicBranch.edit ) ) { return upsertEdit ( ) ; } else if ( caller == ( java.lang.Thread.currentThread ( ) ) ) { return insertPatchSet ( db ) ; } else { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schemaFactory.open ( ) ) { return insertPatchSet ( db ) ; } } } finally { com.google.gerrit.server.git.ReceiveCommits.synchronizedIncrement ( replaceProgress ) ; } }

Target:
public PatchSet.Id call ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException { try { if ( ( ( magicBranch ) != null ) && ( magicBranch.edit ) ) { return upsertEdit ( ) ; } try ( com.google.gerrit.server.git.ReceiveCommits.RequestState state = requestState ( caller ) ) { return insertPatchSet ( state ) ; } } finally { com.google.gerrit.server.git.ReceiveCommits.synchronizedIncrement ( replaceProgress ) ; } }
Source:
public com.google.gerrit.server.project.ProjectState load ( java.lang.String projectName ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey key = new com.google.gerrit.reviewdb.client.Project.NameKey ( projectName ) ; try ( org.eclipse.jgit.lib.Repository git = mgr.openRepository ( key ) ) { com.google.gerrit.server.git.ProjectConfig cfg = new com.google.gerrit.server.git.ProjectConfig ( key ) ; cfg.load ( git ) ; return projectStateFactory.create ( cfg ) ; } }

Target:
public com.google.gerrit.server.project.ProjectState load ( java.lang.String projectName ) throws java.lang.Exception { long now = clock.read ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey key = new com.google.gerrit.reviewdb.client.Project.NameKey ( projectName ) ; try ( org.eclipse.jgit.lib.Repository git = mgr.openRepository ( key ) ) { com.google.gerrit.server.git.ProjectConfig cfg = new com.google.gerrit.server.git.ProjectConfig ( key ) ; cfg.load ( git ) ; com.google.gerrit.server.project.ProjectState state = projectStateFactory.create ( cfg ) ; state.initLastCheck ( now ) ; return state ; } }
Source:
int shutdown ( ) { int cnt = 0 ; if ( ( pool ) != null ) { cnt = pool.shutdownNow ( ) . size ( ) ; pool.unregisterWorkQueue ( ) ; pool = null ; } return cnt ; }

Target:
public int shutdown ( ) { int cnt = 0 ; if ( ( pool ) != null ) { for ( java.lang.Runnable r : pool.getQueue ( ) ) { com.googlesource.gerrit.plugins.replication.Destination.repLog.warn ( java.lang.String.format ( "Cancelling replication event %s" , r ) ) ; } cnt = pool.shutdownNow ( ) . size ( ) ; pool.unregisterWorkQueue ( ) ; pool = null ; } return cnt ; }
Source:
private void activate ( final int patchSetId ) { if ( ( activePatchSetId ) != patchSetId ) { deactivate ( ) ; com.google.gerrit.client.changes.PatchSetComplexDisclosurePanel patchSetPanel = patchSetPanels.get ( patchSetId ) ; patchSetPanel.setOpen ( true ) ; patchSetPanel.setActive ( true ) ; activePatchSetId = patchSetId ; } }

Target:
private void activate ( final com.google.gerrit.reviewdb.PatchSet.Id patchSetId ) { if ( ! ( patchSetId.equals ( activePatchSetId ) ) ) { deactivate ( ) ; com.google.gerrit.client.changes.PatchSetComplexDisclosurePanel patchSetPanel = patchSetPanels.get ( patchSetId ) ; patchSetPanel.setOpen ( true ) ; patchSetPanel.setActive ( true ) ; activePatchSetId = patchSetId ; } }
Source:
public void revokedByKeyNotPresentInStore ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey k = add ( com.google.gerrit.gpg.testutil.TestKeys.revokedCompromisedKey ( ) ) ; save ( ) ; assertProblems ( k ) ; }

Target:
public void revokedKeyDueToCompromiseRevokesKeyRetroactively ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey k = add ( com.google.gerrit.gpg.testutil.TestKeys.revokedCompromisedKey ( ) ) ; add ( com.google.gerrit.gpg.testutil.TestKeys.validKeyWithoutExpiration ( ) ) ; save ( ) ; java.lang.String problem = "Key is revoked (key material has been compromised): test6 compromised" ; assertProblems ( k , problem ) ; java.text.SimpleDateFormat df = new java.text.SimpleDateFormat ( "YYYY-MM-dd HH:mm:ss" ) ; com.google.gerrit.gpg.PublicKeyChecker checker = new com.google.gerrit.gpg.PublicKeyChecker ( ) . setStore ( store ) . setEffectiveTime ( df.parse ( "2010-01-01 12:00:00" ) ) ; assertProblems ( checker , k , problem ) ; }
Source:
private void addProject ( java.nio.file.Path p ) { com.google.gerrit.reviewdb.client.Project.NameKey nameKey = getProjectName ( p ) ; if ( isUnreasonableName ( nameKey ) ) { com.google.gerrit.server.git.LocalDiskRepositoryManager.log.warn ( ( "Ignoring unreasonably named repository " + ( p.toAbsolutePath ( ) ) ) ) ; } else { found.add ( nameKey ) ; } }

Target:
private void addProject ( java.nio.file.Path p ) { com.google.gerrit.reviewdb.client.Project.NameKey nameKey = getProjectName ( p ) ; if ( getBasePath ( nameKey ) . equals ( startFolder ) ) { if ( isUnreasonableName ( nameKey ) ) { com.google.gerrit.server.git.LocalDiskRepositoryManager.log.warn ( ( "Ignoring unreasonably named repository " + ( p.toAbsolutePath ( ) ) ) ) ; } else { found.add ( nameKey ) ; } } }
Source:
private void merge ( com.google.gerrit.acceptance.PushOneCommit.Result r ) throws java.lang.Exception { revision ( r ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) ) ; revision ( r ) . submit ( ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ) { com.google.common.truth.Truth.assertThat ( repo.getRef ( "refs/heads/master" ) . getObjectId ( ) ) . isEqualTo ( r.getCommitId ( ) ) ; } }

Target:
protected void merge ( com.google.gerrit.acceptance.PushOneCommit.Result r ) throws java.lang.Exception { super . merge ( r ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ) { com.google.common.truth.Truth.assertThat ( repo.exactRef ( "refs/heads/master" ) . getObjectId ( ) ) . isEqualTo ( r.getCommit ( ) ) ; } }
Source:
public void testCUSTOM_NullUser ( ) { setFrom ( "A ${user} B <my.server@email.address>" ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( null ) ; org.junit.Assert.assertNotNull ( r ) ; org.junit.Assert.assertEquals ( ident.getName ( ) , r.name ) ; org.junit.Assert.assertEquals ( "my.server@email.address" , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }

Target:
public void testCUSTOM_NoFullNameUser ( ) { setFrom ( "A ${user} B <my.server@email.address>" ) ; final java.lang.String email = "a.u.thor@test.example.com" ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( null , email ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; com.google.common.truth.Truth.assertThat ( r ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( r.name ) . isEqualTo ( "A Anonymous Coward B" ) ; com.google.common.truth.Truth.assertThat ( r.email ) . isEqualTo ( "my.server@email.address" ) ; org.easymock.EasyMock.verify ( accountCache ) ; }
Source:
public com.google.gerrit.reviewdb.AccountGroup createEntry ( final com.google.gerrit.reviewdb.AccountGroup.Id key ) throws java.lang.Exception { return lookup ( key ) ; }

Target:
public com.google.gerrit.reviewdb.AccountGroup missing ( final com.google.gerrit.reviewdb.AccountGroup.Id key ) { final com.google.gerrit.reviewdb.AccountGroup.NameKey name = new com.google.gerrit.reviewdb.AccountGroup.NameKey ( ( "Deleted Group" + ( key.toString ( ) ) ) ) ; final com.google.gerrit.reviewdb.AccountGroup g = new com.google.gerrit.reviewdb.AccountGroup ( name , key ) ; g.setType ( AccountGroup.Type.SYSTEM ) ; g.setOwnerGroupId ( administrators ) ; return g ; }
Source:
void schedule ( final com.google.gerrit.client.reviewdb.Project.NameKey project , final java.lang.String ref , final org.spearce.jgit.transport.URIish uri ) { synchronized ( pending ) { com.google.gerrit.git.PushOp e = pending.get ( uri ) ; if ( e == null ) { e = new com.google.gerrit.git.PushOp ( this , project.get ( ) , remote , uri ) ; injector.injectMembers ( e ) ; pool.schedule ( e , delay , java.util.concurrent.TimeUnit.SECONDS ) ; pending.put ( uri , e ) ; } e.addRef ( ref ) ; } }

Target:
void schedule ( final com.google.gerrit.client.reviewdb.Project.NameKey project , final java.lang.String ref , final org.spearce.jgit.transport.URIish uri ) { synchronized ( pending ) { com.google.gerrit.git.PushOp e = pending.get ( uri ) ; if ( e == null ) { e = opFactory.create ( project.get ( ) , uri ) ; pool.schedule ( e , delay , java.util.concurrent.TimeUnit.SECONDS ) ; pending.put ( uri , e ) ; } e.addRef ( ref ) ; } }
Source:
public Account.Id createEntry ( final com.google.gerrit.reviewdb.Account.Username username ) throws java.lang.Exception { final com.google.gerrit.reviewdb.ReviewDb db = schema.open ( ) ; try { final com.google.gerrit.reviewdb.AccountExternalId.Key key = new com.google.gerrit.reviewdb.AccountExternalId.Key ( com.google.gerrit.reviewdb.AccountExternalId.SCHEME_USERNAME , username.get ( ) ) ; final com.google.gerrit.reviewdb.AccountExternalId id = db.accountExternalIds ( ) . get ( key ) ; return id != null ? id.getAccountId ( ) : null ; } finally { db.close ( ) ; } }

Target:
public Account.Id createEntry ( final com.google.gerrit.reviewdb.Account.Username username ) throws java.lang.Exception { final com.google.gerrit.reviewdb.ReviewDb db = schema.open ( ) ; try { final com.google.gerrit.reviewdb.AccountExternalId.Key key = new com.google.gerrit.reviewdb.AccountExternalId.Key ( com.google.gerrit.reviewdb.AccountExternalId.SCHEME_USERNAME , username.get ( ) ) ; final com.google.gerrit.reviewdb.AccountExternalId id = accountExternalIdCache.get ( key ) ; return id != null ? id.getAccountId ( ) : null ; } finally { db.close ( ) ; } }
Source:
protected boolean onKeyPress ( final char keyCode , final int modifiers ) { if ( modifiers == 0 ) { switch ( keyCode ) { case 'k' : case com.google.gwt.user.client.ui.KeyboardListener.KEY_UP : onUp ( ) ; return true ; case 'j' : case com.google.gwt.user.client.ui.KeyboardListener.KEY_DOWN : onDown ( ) ; return true ; case 'o' : case com.google.gwt.user.client.ui.KeyboardListener.KEY_ENTER : onOpen ( ) ; return true ; } } return false ; }

Target:
protected boolean onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { if ( ! ( event.isAnyModifierKeyDown ( ) ) ) { switch ( event.getCharCode ( ) ) { case 'k' : case com.google.gwt.event.dom.client.KeyCodes.KEY_UP : onUp ( ) ; return true ; case 'j' : case com.google.gwt.event.dom.client.KeyCodes.KEY_DOWN : onDown ( ) ; return true ; case 'o' : case com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER : onOpen ( ) ; return true ; } } return false ; }
Source:
private java.io.Writer newWriter ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { java.io.OutputStream out ; if ( com.google.gitiles.BaseServlet.acceptsGzipEncoding ( req ) ) { res.setHeader ( com.google.common.net.HttpHeaders.CONTENT_ENCODING , "gzip" ) ; out = new java.util.zip.GZIPOutputStream ( res.getOutputStream ( ) ) ; } else { out = res.getOutputStream ( ) ; } return com.google.gitiles.BaseServlet.newWriter ( out , res ) ; }

Target:
private java.io.Writer newWriter ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { java.io.OutputStream out ; if ( com.google.gitiles.BaseServlet.acceptsGzipEncoding ( req ) ) { res.addHeader ( com.google.common.net.HttpHeaders.VARY , com.google.common.net.HttpHeaders.ACCEPT_ENCODING ) ; res.setHeader ( com.google.common.net.HttpHeaders.CONTENT_ENCODING , "gzip" ) ; out = new java.util.zip.GZIPOutputStream ( res.getOutputStream ( ) ) ; } else { out = res.getOutputStream ( ) ; } return com.google.gitiles.BaseServlet.newWriter ( out , res ) ; }
Source:
private boolean isAdminHighPriorityCommand ( ) { return ( getClass ( ) . getAnnotation ( com.google.gerrit.sshd.AdminHighPriorityCommand.class ) ) != null ; }

Target:
private boolean isAdminHighPriorityCommand ( ) { if ( ( getClass ( ) . getAnnotation ( com.google.gerrit.sshd.AdminHighPriorityCommand.class ) ) != null ) { try { permissionBackend.user ( user ) . check ( GlobalPermission.ADMINISTRATE_SERVER ) ; return true ; } catch ( com.google.gerrit.extensions.restapi.AuthException | com.google.gerrit.server.permissions.PermissionBackendException e ) { return false ; } } return false ; }
Source:
private void sendError ( javax.servlet.http.HttpServletResponse rsp , int statusCode , java.lang.String message ) { try { rsp.sendError ( statusCode , message ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.AbstractIndexRestApiServlet.logger.error ( ( "Failed to send error messsage: " + ( e.getMessage ( ) ) ) , e ) ; } }

Target:
private void sendError ( javax.servlet.http.HttpServletResponse rsp , int statusCode , java.lang.String message ) { try { rsp.sendError ( statusCode , message ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.AbstractIndexRestApiServlet.logger.error ( "Failed to send error messsage: {}" , e.getMessage ( ) , e ) ; } }
Source:
public static com.google.gerrit.common.data.GroupReference findExactSuggestion ( com.google.gerrit.server.account.GroupBackend groupBackend , java.lang.String name ) { java.util.Collection < com.google.gerrit.common.data.GroupReference > refs = groupBackend.suggest ( name ) ; for ( com.google.gerrit.common.data.GroupReference ref : refs ) { if ( com.google.gerrit.server.account.GroupBackends.isExactSuggestion ( ref , name ) ) { return ref ; } } return null ; }

Target:
public static com.google.gerrit.common.data.GroupReference findExactSuggestion ( com.google.gerrit.server.account.GroupBackend groupBackend , java.lang.String name , com.google.gerrit.server.project.ProjectControl project ) { java.util.Collection < com.google.gerrit.common.data.GroupReference > refs = groupBackend.suggest ( name , project ) ; for ( com.google.gerrit.common.data.GroupReference ref : refs ) { if ( com.google.gerrit.server.account.GroupBackends.isExactSuggestion ( ref , name ) ) { return ref ; } } return null ; }
Source:
public void onKeyPress ( com.google.gwt.user.client.ui.Widget sender , char keyCode , int modifiers ) { if ( keyCode == ( KEY_ENTER ) ) { final com.google.gwt.user.client.Event event = com.google.gwt.user.client.DOM.eventGetCurrentEvent ( ) ; com.google.gwt.user.client.DOM.eventCancelBubble ( event , true ) ; com.google.gwt.user.client.DOM.eventPreventDefault ( event ) ; form.submit ( ) ; } }

Target:
public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { if ( ( event.getCharCode ( ) ) == ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) ) { event.stopPropagation ( ) ; event.preventDefault ( ) ; form.submit ( ) ; } }
Source:
private org.eclipse.jgit.api.Git createProject ( boolean emptyCommit ) throws com.jcraft.jsch.JSchException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.SshSession sshSession = new com.google.gerrit.acceptance.SshSession ( server , admin ) ; try { com.google.gerrit.acceptance.git.GitUtil.createProject ( sshSession , project.get ( ) , null , emptyCommit ) ; setSubmitType ( getSubmitType ( ) ) ; return com.google.gerrit.acceptance.git.GitUtil.cloneProject ( ( ( ( sshSession.getUrl ( ) ) + "/" ) + ( project.get ( ) ) ) ) ; } finally { sshSession.close ( ) ; } }

Target:
private org.eclipse.jgit.api.Git createProject ( boolean emptyCommit ) throws com.jcraft.jsch.JSchException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.SshSession sshSession = new com.google.gerrit.acceptance.SshSession ( server , admin ) ; try { com.google.gerrit.acceptance.GitUtil.createProject ( sshSession , project.get ( ) , null , emptyCommit ) ; setSubmitType ( getSubmitType ( ) ) ; return com.google.gerrit.acceptance.GitUtil.cloneProject ( ( ( ( sshSession.getUrl ( ) ) + "/" ) + ( project.get ( ) ) ) ) ; } finally { sshSession.close ( ) ; } }
Source:
private org.eclipse.jgit.lib.PersonIdent newAuthorIdent ( ) { com.google.gerrit.server.CurrentUser u = getUser ( ) ; if ( u instanceof com.google.gerrit.server.IdentifiedUser ) { return noteUtil.newIdent ( u.asIdentifiedUser ( ) . getAccount ( ) , when , serverIdent , anonymousCowardName ) ; } else if ( u instanceof com.google.gerrit.server.InternalUser ) { return serverIdent ; } throw new java.lang.IllegalStateException ( ) ; }

Target:
public void setPatchSetId ( com.google.gerrit.reviewdb.client.PatchSet.Id psId ) { com.google.common.base.Preconditions.checkArgument ( ( ( psId == null ) || ( psId.getParentKey ( ) . equals ( getId ( ) ) ) ) ) ; this . psId = psId ; }
Source:
protected void configure ( ) { bind ( java.util.concurrent.ScheduledExecutorService.class ) . annotatedWith ( com.googlesource.gerrit.plugins.webhooks.WebHooksExecutor.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.ExecutorProvider.class ) ; bind ( com.googlesource.gerrit.plugins.webhooks.Configuration.class ) . in ( Scopes.SINGLETON ) ; bind ( org.apache.http.impl.client.CloseableHttpClient.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.HttpClientProvider.class ) . in ( Scopes.SINGLETON ) ; factory ( PostTask.Factory.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.EventListener.class ) . to ( com.googlesource.gerrit.plugins.webhooks.EventHandler.class ) ; }

Target:
protected void configure ( ) { bind ( java.util.concurrent.ScheduledExecutorService.class ) . annotatedWith ( com.googlesource.gerrit.plugins.webhooks.WebHooksExecutor.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.ExecutorProvider.class ) ; bind ( org.apache.http.impl.client.CloseableHttpClient.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.HttpClientProvider.class ) . in ( Scopes.SINGLETON ) ; factory ( PostTask.Factory.class ) ; factory ( RemoteConfig.Factory.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.EventListener.class ) . to ( com.googlesource.gerrit.plugins.webhooks.EventHandler.class ) ; install ( processors ) ; }
Source:
public void start ( final org.apache.sshd.server.Environment env ) { startThread ( new com.google.gerrit.sshd.commands.CommandRunnable ( ) { @ java.lang.Override public void run ( ) throws java.lang.Exception { parseCommandLine ( ) ; com.google.gerrit.sshd.commands.AdminShowQueue.this . display ( ) ; } } ) ; }

Target:
public void start ( final org.apache.sshd.server.Environment env ) { java.lang.String s = env.getEnv ( ) . get ( Environment.ENV_COLUMNS ) ; if ( ( s != null ) && ( ! ( s.isEmpty ( ) ) ) ) { try { columns = java.lang.Integer.parseInt ( s ) ; } catch ( java.lang.NumberFormatException err ) { columns = 80 ; } } startThread ( new com.google.gerrit.sshd.commands.CommandRunnable ( ) { @ java.lang.Override public void run ( ) throws java.lang.Exception { parseCommandLine ( ) ; com.google.gerrit.sshd.commands.AdminShowQueue.this . display ( ) ; } } ) ; }
Source:
public void createdOnIsPopulatedForGroupsCreatedAfterAudit ( ) throws java.lang.Exception { java.sql.Timestamp testStartTime = com.google.gerrit.common.TimeUtil.nowTs ( ) ; com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroup ( "Group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.server.schema.Schema_150_to_151_Test.TestUpdateUI ( ) ) ; com.google.gerrit.reviewdb.client.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; com.google.common.truth.Truth.assertThat ( group.getCreatedOn ( ) ) . isAtLeast ( testStartTime ) ; }

Target:
public void createdOnIsPopulatedForGroupsCreatedBeforeAudit ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroup ( "Ancient group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; removeAuditEntriesFor ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.testutil.TestUpdateUI ( ) ) ; com.google.gerrit.reviewdb.client.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; com.google.common.truth.Truth.assertThat ( group.getCreatedOn ( ) ) . isEqualTo ( com.google.gerrit.reviewdb.client.AccountGroup.auditCreationInstantTs ( ) ) ; }
Source:
public void run ( ) { if ( reload ( ) ) { trigger.run ( ) ; } }

Target:
public void run ( ) { if ( reload ( ) ) { synchronized ( reloadLock ) { for ( com.google.gerrit.metrics.dropwizard.CallbackMetricGlue m : metrics ) { m.beginSet ( ) ; } trigger.run ( ) ; for ( com.google.gerrit.metrics.dropwizard.CallbackMetricGlue m : metrics ) { m.endSet ( ) ; } } } }
Source:
public void createdOnIsPopulatedForGroupsCreatedAfterAudit ( ) throws java.lang.Exception { java.sql.Timestamp testStartTime = com.google.gerrit.common.TimeUtil.nowTs ( ) ; com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroup ( "Group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.testing.TestUpdateUI ( ) ) ; java.sql.Timestamp createdOn = getCreatedOn ( groupId ) ; com.google.common.truth.Truth.assertThat ( createdOn ) . isAtLeast ( testStartTime ) ; }

Target:
public void createdOnIsPopulatedForGroupsCreatedAfterAudit ( ) throws java.lang.Exception { java.sql.Timestamp testStartTime = com.google.gerrit.common.TimeUtil.nowTs ( ) ; com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroupInReviewDb ( "Group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.testing.TestUpdateUI ( ) ) ; java.sql.Timestamp createdOn = getCreatedOn ( groupId ) ; com.google.common.truth.Truth.assertThat ( createdOn ) . isAtLeast ( testStartTime ) ; }
Source:
public void start ( ) { org.apache.log4j.Logger replicationLogger = org.apache.log4j.LogManager.getLogger ( ReplicationQueue.REPLICATION_LOG_NAME ) ; replicationLogger.removeAllAppenders ( ) ; replicationLogger.addAppender ( systemLog.createAsyncAppender ( replicationLogger.getName ( ) , new org.apache.log4j.PatternLayout ( "[%d] %m%n" ) ) ) ; replicationLogger.setAdditivity ( false ) ; }

Target:
public void start ( ) { org.apache.log4j.Logger replicationLogger = org.apache.log4j.LogManager.getLogger ( ReplicationQueue.REPLICATION_LOG_NAME ) ; replicationLogger.removeAllAppenders ( ) ; replicationLogger.addAppender ( systemLog.createAsyncAppender ( replicationLogger.getName ( ) , new org.apache.log4j.PatternLayout ( ( ( "[%d] [%X{" + ( PushOne.ID_MDC_KEY ) ) + "}] %m%n" ) ) ) ) ; replicationLogger.setAdditivity ( false ) ; }
Source:
private static com.google.gerrit.client.reviewdb.AccountExternalId lookupGoogleAccount ( final com.google.gerrit.client.reviewdb.AccountExternalIdAccess extAccess , final java.lang.String email ) throws com.google.gwtorm.client.OrmException { final java.util.List < com.google.gerrit.client.reviewdb.AccountExternalId > m = new java.util.ArrayList < com.google.gerrit.client.reviewdb.AccountExternalId > ( ) ; for ( final com.google.gerrit.client.reviewdb.AccountExternalId e : extAccess.byEmailAddress ( email ) ) { if ( e.getExternalId ( ) . equals ( ( "Google Account " + email ) ) ) { m.add ( e ) ; } } return ( m.size ( ) ) == 1 ? m.get ( 0 ) : null ; }

Target:
private static com.google.gerrit.client.reviewdb.AccountExternalId lookupGoogleAccount ( final com.google.gerrit.client.reviewdb.AccountExternalIdAccess extAccess , final java.lang.String email ) throws com.google.gwtorm.client.OrmException { final java.util.List < com.google.gerrit.client.reviewdb.AccountExternalId > m = new java.util.ArrayList < com.google.gerrit.client.reviewdb.AccountExternalId > ( ) ; for ( final com.google.gerrit.client.reviewdb.AccountExternalId e : extAccess.byEmailAddress ( email ) ) { if ( e.getExternalId ( ) . equals ( ( ( com.google.gerrit.client.reviewdb.AccountExternalId.LEGACY_GAE ) + email ) ) ) { m.add ( e ) ; } } return ( m.size ( ) ) == 1 ? m.get ( 0 ) : null ; }
Source:
public boolean accept ( java.io.File path ) { java.lang.String name = path.getName ( ) ; return ( ( name.endsWith ( ".jar" ) ) || ( name.endsWith ( ".zip" ) ) ) && ( path.isFile ( ) ) ; }

Target:
public boolean accept ( java.nio.file.Path entry ) throws java.io.IOException { java.lang.String name = entry.getFileName ( ) . toString ( ) ; return ( ( name.endsWith ( ".jar" ) ) || ( name.endsWith ( ".zip" ) ) ) && ( java.nio.file.Files.isRegularFile ( entry ) ) ; }
Source:
public void listOneIncludeMember ( ) throws java.lang.Exception { java.lang.String gx = group ( "gx" ) ; java.lang.String gy = group ( "gy" ) ; gApi.groups ( ) . id ( gx ) . addGroups ( gy ) ; assertIncludes ( gApi.groups ( ) . id ( gx ) . includedGroups ( ) , gy ) ; }

Target:
private void assertIncludes ( java.lang.String group , java.lang.String ... expectedNames ) throws java.lang.Exception { assertIncludes ( gApi.groups ( ) . id ( group ) . includedGroups ( ) , expectedNames ) ; }
Source:
public Account.Id apply ( java.lang.String refPart ) { return Account.Id.fromRefPart ( refPart ) ; }

Target:
public boolean apply ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { try { return com.google.gerrit.server.StarredChangesUtil.readLabels ( repo , com.google.gerrit.reviewdb.client.RefNames.refsStarredChanges ( changeId , accountId ) ) . contains ( label ) ; } catch ( java.io.IOException e ) { com.google.gerrit.server.StarredChangesUtil.log.error ( java.lang.String.format ( "Cannot query stars by account %d on change %d" , accountId.get ( ) , changeId.get ( ) ) , e ) ; return false ; } }
Source:
public static synchronized void setClockStep ( long clockStep , java.util.concurrent.TimeUnit clockStepUnit ) { com.google.common.base.Preconditions.checkState ( ( ( com.google.gerrit.testutil.TestTimeUtil.clockMs ) != null ) , "call resetWithClockStep first" ) ; com.google.gerrit.testutil.TestTimeUtil.clockStepMs = java.util.concurrent.TimeUnit.MILLISECONDS.convert ( clockStep , clockStepUnit ) ; org.joda.time.DateTimeUtils.setCurrentMillisProvider ( new org.joda.time.DateTimeUtils.MillisProvider ( ) { @ java.lang.Override public long getMillis ( ) { return com.google.gerrit.testutil.TestTimeUtil.clockMs.getAndAdd ( com.google.gerrit.testutil.TestTimeUtil.clockStepMs ) ; } } ) ; }

Target:
public java.lang.String getHostname ( ) { return defaultReader.getHostname ( ) ; }
Source:
private boolean isEditModeEnabled ( com.google.gerrit.client.changes.ChangeInfo info , com.google.gerrit.client.changes.ChangeInfo.RevisionInfo rev ) { if ( rev.isEdit ( ) ) { return true ; } if ( ( edit ) == null ) { return revision.equals ( info.currentRevision ( ) ) ; } return ( rev._number ( ) ) == ( com.google.gerrit.client.changes.ChangeInfo.RevisionInfo.findEditParent ( info.revisions ( ) . values ( ) ) ) ; }

Target:
private boolean isEditModeEnabled ( com.google.gerrit.client.info.ChangeInfo info , com.google.gerrit.client.info.ChangeInfo.RevisionInfo rev ) { if ( rev.isEdit ( ) ) { return true ; } if ( ( edit ) == null ) { return revision.equals ( info.currentRevision ( ) ) ; } return ( rev._number ( ) ) == ( com.google.gerrit.client.info.ChangeInfo.RevisionInfo.findEditParent ( info.revisions ( ) . values ( ) ) ) ; }