auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void configure ( ) { propertyExtractor = createMock ( com.googlesource.gerrit.plugins.hooks.util.PropertyExtractor.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.util.PropertyExtractor.class ) . toInstance ( propertyExtractor ) ; ruleBase = createMock ( com.googlesource.gerrit.plugins.hooks.workflow.RuleBase.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.workflow.RuleBase.class ) . toInstance ( ruleBase ) ; actionExecutor = createMock ( com.googlesource.gerrit.plugins.hooks.workflow.ActionExecutor.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.workflow.ActionExecutor.class ) . toInstance ( actionExecutor ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsConfig.class ) . toInstance ( new com.googlesource.gerrit.plugins.hooks.its.ItsConfig ( null , null ) { @ java.lang.Override public boolean isEnabled ( com.google.gerrit.server.events.ChangeEvent event ) { return true ; } } ) ; }

Target:
protected void configure ( ) { propertyExtractor = createMock ( com.googlesource.gerrit.plugins.hooks.util.PropertyExtractor.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.util.PropertyExtractor.class ) . toInstance ( propertyExtractor ) ; ruleBase = createMock ( com.googlesource.gerrit.plugins.hooks.workflow.RuleBase.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.workflow.RuleBase.class ) . toInstance ( ruleBase ) ; actionExecutor = createMock ( com.googlesource.gerrit.plugins.hooks.workflow.ActionExecutor.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.workflow.ActionExecutor.class ) . toInstance ( actionExecutor ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsConfig.class ) . toInstance ( new com.googlesource.gerrit.plugins.hooks.its.ItsConfig ( null , null , null ) { @ java.lang.Override public boolean isEnabled ( com.google.gerrit.server.events.ChangeEvent event ) { return true ; } } ) ; }
Source:
protected void includeWatchers ( com.google.gerrit.server.account.WatchConfig.NotifyType type ) { try { com.google.gerrit.server.mail.send.ProjectWatch.Watchers matching = getWatchers ( type ) ; add ( RecipientType.TO , matching.to ) ; add ( RecipientType.CC , matching.cc ) ; add ( RecipientType.BCC , matching.bcc ) ; } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.send.NotificationEmail.log.warn ( ( "Cannot BCC watchers for " + type ) , err ) ; } }

Target:
protected void includeWatchers ( com.google.gerrit.server.account.WatchConfig.NotifyType type ) { includeWatchers ( type , true ) ; }
Source:
private com.google.gerrit.server.util.RequestContext newRequestContext ( com.google.gerrit.reviewdb.client.Account.Id requestUserId ) { final com.google.gerrit.server.CurrentUser requestUser = userFactory.create ( requestUserId ) ; return new com.google.gerrit.server.util.RequestContext ( ) { @ java.lang.Override public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { return requestUser ; } @ java.lang.Override public com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > getReviewDbProvider ( ) { return com.google.inject.util.Providers.of ( db ) ; } } ; }

Target:
private com.google.gerrit.server.util.RequestContext newRequestContext ( com.google.gerrit.reviewdb.client.Account.Id requestUserId ) { final com.google.gerrit.server.CurrentUser requestUser = userFactory.create ( com.google.inject.util.Providers.of ( db ) , requestUserId ) ; return new com.google.gerrit.server.util.RequestContext ( ) { @ java.lang.Override public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { return requestUser ; } @ java.lang.Override public com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > getReviewDbProvider ( ) { return com.google.inject.util.Providers.of ( db ) ; } } ; }
Source:
public void missingOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.TestAccount owner = accountCreator.create ( "missing" ) ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( owner ) ; accountsUpdate.create ( ) . deleteByKey ( db , owner.getId ( ) ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Missing change owner: " + ( owner.getId ( ) ) ) ) ) ; }

Target:
public void missingOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.TestAccount owner = accountCreator.create ( "missing" ) ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( owner ) ; accountsUpdate.create ( ) . deleteByKey ( owner.getId ( ) ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Missing change owner: " + ( owner.getId ( ) ) ) ) ) ; }
Source:
public boolean updateChange ( com.google.gerrit.server.update.ChangeContext ctx ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = ctx.getChange ( ) ; if ( ( change.getStatus ( ) ) == ( Change.Status.MERGED ) ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "change is merged" ) ; } com.google.gerrit.server.notedb.ChangeUpdate update = ctx.getUpdate ( change.currentPatchSetId ( ) ) ; change.setPrivate ( isPrivate ) ; change.setLastUpdatedOn ( ctx.getWhen ( ) ) ; update.setPrivate ( isPrivate ) ; addMessage ( ctx , update ) ; return true ; }

Target:
public boolean updateChange ( com.google.gerrit.server.update.ChangeContext ctx ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = ctx.getChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = ctx.getUpdate ( change.currentPatchSetId ( ) ) ; change.setPrivate ( isPrivate ) ; change.setLastUpdatedOn ( ctx.getWhen ( ) ) ; update.setPrivate ( isPrivate ) ; addMessage ( ctx , update ) ; return true ; }
Source:
public void deleteBranchesNotFoundContinue ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.DeleteBranchesInput input = new com.google.gerrit.extensions.api.projects.DeleteBranchesInput ( ) ; java.util.List < java.lang.String > branches = com.google.common.collect.Lists.newArrayList ( "refs/heads/does-not-exist" ) ; branches.addAll ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; input.branches = branches ; try { project ( ) . deleteBranches ( input ) ; org.junit.Assert.fail ( "Expected ResourceConflictException" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceConflictException e ) { com.google.common.truth.Truth.assertThat ( e ) . hasMessageThat ( ) . isEqualTo ( errorMessageForBranches ( com.google.common.collect.ImmutableList.of ( "refs/heads/does-not-exist" ) ) ) ; } assertBranchesDeleted ( ) ; }

Target:
public void deleteBranchesNotFoundContinue ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.DeleteBranchesInput input = new com.google.gerrit.extensions.api.projects.DeleteBranchesInput ( ) ; java.util.List < java.lang.String > branches = com.google.common.collect.Lists.newArrayList ( "refs/heads/does-not-exist" ) ; branches.addAll ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; input.branches = branches ; try { project ( ) . deleteBranches ( input ) ; org.junit.Assert.fail ( "Expected ResourceConflictException" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceConflictException e ) { com.google.common.truth.Truth.assertThat ( e ) . hasMessageThat ( ) . isEqualTo ( errorMessageForBranches ( com.google.common.collect.ImmutableList.of ( "refs/heads/does-not-exist" ) ) ) ; } assertBranchesDeleted ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; }
Source:
public void testStop ( ) throws java.lang.Exception { eventsExecutorProvider.start ( ) ; com.google.common.truth.Truth.assertThat ( eventsExecutorProvider.get ( ) ) . isEqualTo ( executorMock ) ; eventsExecutorProvider.stop ( ) ; org.mockito.Mockito.verify ( executorMock ) . shutdown ( ) ; org.mockito.Mockito.verify ( executorMock ) . unregisterWorkQueue ( ) ; com.google.common.truth.Truth.assertThat ( eventsExecutorProvider.get ( ) ) . isNull ( ) ; }

Target:
public void testStop ( ) throws java.lang.Exception { eventsExecutorProvider.start ( ) ; com.google.common.truth.Truth.assertThat ( eventsExecutorProvider.get ( ) ) . isEqualTo ( executorMock ) ; eventsExecutorProvider.stop ( ) ; org.mockito.Mockito.verify ( executorMock ) . shutdown ( ) ; com.google.common.truth.Truth.assertThat ( eventsExecutorProvider.get ( ) ) . isNull ( ) ; }
Source:
private com.google.gerrit.common.data.SubmitTypeRecord typeError ( java.lang.String err ) { if ( logErrors ) { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err ) ; return com.google.gerrit.server.project.SubmitRuleEvaluator.defaultTypeError ( ) ; } else { return com.google.gerrit.server.project.SubmitRuleEvaluator.createTypeError ( err ) ; } }

Target:
private com.google.gerrit.common.data.SubmitTypeRecord typeError ( java.lang.String err , java.lang.Exception e ) { if ( logErrors ) { if ( e == null ) { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err ) ; } else { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err , e ) ; } return com.google.gerrit.server.project.SubmitRuleEvaluator.defaultTypeError ( ) ; } else { return com.google.gerrit.server.project.SubmitRuleEvaluator.createTypeError ( err ) ; } }
Source:
public void onSuccess ( final java.util.List < com.google.gerrit.common.data.ReviewerInfo > result ) { final java.util.List < com.google.gerrit.client.ui.ReviewerSuggestOracle.ReviewerSuggestion > r = new java.util.ArrayList < com.google.gerrit.client.ui.ReviewerSuggestOracle.ReviewerSuggestion > ( result.size ( ) ) ; for ( final com.google.gerrit.common.data.ReviewerInfo reviewer : result ) { r.add ( new com.google.gerrit.client.ui.ReviewerSuggestOracle.ReviewerSuggestion ( reviewer ) ) ; } callback.onSuggestionsReady ( req , new com.google.gerrit.client.ui.Response ( r ) ) ; }

Target:
public void onSuccess ( final java.util.List < com.google.gerrit.common.data.ReviewerInfo > result ) { final java.util.List < com.google.gerrit.client.ui.ReviewerSuggestOracle.ReviewerSuggestion > r = new java.util.ArrayList ( result.size ( ) ) ; for ( final com.google.gerrit.common.data.ReviewerInfo reviewer : result ) { r.add ( new com.google.gerrit.client.ui.ReviewerSuggestOracle.ReviewerSuggestion ( reviewer ) ) ; } callback.onSuggestionsReady ( req , new com.google.gerrit.client.ui.Response ( r ) ) ; }
Source:
public com.google.gerrit.testutil.InMemoryDatabase create ( ) throws com.google.gwtorm.server.OrmException { if ( ! ( created ) ) { created = true ; final com.google.gerrit.reviewdb.server.ReviewDb c = open ( ) ; try { try { schemaCreator.create ( c ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( "Cannot create in-memory database" , e ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new com.google.gwtorm.server.OrmException ( "Cannot create in-memory database" , e ) ; } } finally { c.close ( ) ; } } return this ; }

Target:
public com.google.gerrit.testutil.InMemoryDatabase create ( ) throws com.google.gwtorm.server.OrmException { if ( ! ( created ) ) { created = true ; try ( com.google.gerrit.reviewdb.server.ReviewDb c = open ( ) ) { schemaCreator.create ( c ) ; } catch ( java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new com.google.gwtorm.server.OrmException ( "Cannot create in-memory database" , e ) ; } } return this ; }
Source:
public static void assertProjectOwners ( java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > expectedOwners , com.google.gerrit.server.project.ProjectState state ) { for ( com.google.gerrit.reviewdb.client.AccountGroup.UUID g : state.getOwners ( ) ) { com.google.common.truth.Truth.assertThat ( expectedOwners.remove ( g ) ) . isTrue ( ) ; } com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < ? > ) ( expectedOwners ) ) ) . isEmpty ( ) ; }

Target:
public static void assertProjectOwners ( java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > expectedOwners , com.google.gerrit.server.project.ProjectState state ) { for ( com.google.gerrit.reviewdb.client.AccountGroup.UUID g : state.getOwners ( ) ) { com.google.common.truth.Truth.assertThat ( expectedOwners.remove ( g ) ) . isTrue ( ) ; } com.google.common.truth.Truth.assertThat ( expectedOwners ) . isEmpty ( ) ; }
Source:
public synchronized void start ( ) { com.google.gerrit.server.plugins.PluginLoader.log.info ( ( "Loading plugins from " + ( pluginsDir.getAbsolutePath ( ) ) ) ) ; srvInfoImpl.state = ServerInformation.State.STARTUP ; rescan ( false ) ; srvInfoImpl.state = ServerInformation.State.RUNNING ; if ( ( scanner ) != null ) { scanner.start ( ) ; } }

Target:
public synchronized void start ( ) { com.google.gerrit.server.plugins.PluginLoader.log.info ( ( "Loading plugins from " + ( pluginsDir.getAbsolutePath ( ) ) ) ) ; srvInfoImpl.state = ServerInformation.State.STARTUP ; rescan ( ) ; srvInfoImpl.state = ServerInformation.State.RUNNING ; if ( ( scanner ) != null ) { scanner.start ( ) ; } }
Source:
public void setUp ( ) throws java.lang.Exception { project2 = new com.google.gerrit.reviewdb.client.Project.NameKey ( "p2" ) ; com.google.gerrit.acceptance.GitUtil.createProject ( sshSession , project2.get ( ) ) ; project3 = new com.google.gerrit.reviewdb.client.Project.NameKey ( "p3" ) ; com.google.gerrit.acceptance.GitUtil.createProject ( sshSession , project3.get ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { project2 = new com.google.gerrit.reviewdb.client.Project.NameKey ( "p2" ) ; createProject ( project2.get ( ) ) ; project3 = new com.google.gerrit.reviewdb.client.Project.NameKey ( "p3" ) ; createProject ( project3.get ( ) ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.account.AccountResource rsrc , com.google.gerrit.server.account.DeleteActive.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ( self.get ( ) ) == ( rsrc.getUser ( ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "cannot deactivate own account" ) ; } return setInactiveFlag.deactivate ( rsrc.getUser ( ) ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.account.AccountResource rsrc , com.google.gerrit.server.account.DeleteActive.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ( self.get ( ) ) == ( rsrc.getUser ( ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "cannot deactivate own account" ) ; } return setInactiveFlag.deactivate ( rsrc.getUser ( ) . getAccountId ( ) ) ; }
Source:
public void storeEvent ( java.lang.String projectName , java.sql.Timestamp timestamp , java.lang.String event ) throws java.sql.SQLException { try ( java.sql.Connection conn = ds.getConnection ( ) ; java.sql.Statement stat = conn.createStatement ( ) ) { stat.execute ( ( ( java.lang.String.format ( "INSERT INTO %s(%s, %s, %s) " , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.TABLE_NAME , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.PROJECT_ENTRY , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.DATE_ENTRY , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.EVENT_ENTRY ) ) + ( java.lang.String.format ( "VALUES('%s', '%s', '%s')" , projectName , timestamp , event ) ) ) ) ; } }

Target:
public void storeEvent ( java.lang.String projectName , java.sql.Timestamp timestamp , java.lang.String event ) throws java.sql.SQLException { execute ( ( ( java.lang.String.format ( "INSERT INTO %s(%s, %s, %s) " , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.TABLE_NAME , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.PROJECT_ENTRY , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.DATE_ENTRY , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.EVENT_ENTRY ) ) + ( java.lang.String.format ( "VALUES('%s', '%s', '%s')" , projectName , timestamp , event ) ) ) ) ; }
Source:
void updateRenderEntireFile ( ) { cmA.removeKeyMap ( com.google.gerrit.client.diff.SideBySide2.RENDER_ENTIRE_FILE_KEYMAP ) ; cmB.removeKeyMap ( com.google.gerrit.client.diff.SideBySide2.RENDER_ENTIRE_FILE_KEYMAP ) ; if ( prefs.renderEntireFile ( ) ) { cmA.addKeyMap ( com.google.gerrit.client.diff.SideBySide2.RENDER_ENTIRE_FILE_KEYMAP ) ; cmB.addKeyMap ( com.google.gerrit.client.diff.SideBySide2.RENDER_ENTIRE_FILE_KEYMAP ) ; } cmA.setOption ( "viewportMargin" , ( prefs.renderEntireFile ( ) ? java.lang.Double.POSITIVE_INFINITY : 10 ) ) ; cmB.setOption ( "viewportMargin" , ( prefs.renderEntireFile ( ) ? java.lang.Double.POSITIVE_INFINITY : 10 ) ) ; }

Target:
void updateRenderEntireFile ( ) { cmA.setOption ( "viewportMargin" , ( prefs.renderEntireFile ( ) ? java.lang.Double.POSITIVE_INFINITY : 10 ) ) ; cmB.setOption ( "viewportMargin" , ( prefs.renderEntireFile ( ) ? java.lang.Double.POSITIVE_INFINITY : 10 ) ) ; }
Source:
void send ( java.lang.String message ) { com.google.gerrit.client.changes.ChangeApi.createChange ( project , branch , message , base , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( result.legacyId ( ) ) ) ; hide ( ) ; } } ) ; }

Target:
void send ( java.lang.String message ) { com.google.gerrit.client.changes.ChangeApi.createChange ( project , branch , null , message , base , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( result.legacyId ( ) ) ) ; hide ( ) ; } } ) ; }
Source:
public void start ( 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 ( impl ) ; final java.io.PrintWriter stdout = toPrintWriter ( out ) ; try { impl.display ( stdout ) ; } finally { stdout.flush ( ) ; } } } ) ; }

Target:
public void run ( ) throws java.lang.Exception { impl.display ( stdout ) ; }
Source:
private static com.google.gerrit.server.query.change.ChangeData change ( java.lang.String ... files ) { java.util.Arrays.sort ( files ) ; com.google.gerrit.server.query.change.ChangeData cd = new com.google.gerrit.server.query.change.ChangeData ( new com.google.gerrit.reviewdb.client.Change.Id ( 1 ) ) ; cd.setCurrentFilePaths ( java.util.Arrays.asList ( files ) ) ; return cd ; }

Target:
private static com.google.gerrit.server.query.change.ChangeData change ( java.lang.String ... files ) { java.util.Arrays.sort ( files ) ; com.google.gerrit.server.query.change.ChangeData cd = new com.google.gerrit.server.query.change.ChangeData ( null , null , null , new com.google.gerrit.reviewdb.client.Change.Id ( 1 ) ) ; cd.setCurrentFilePaths ( java.util.Arrays.asList ( files ) ) ; return cd ; }
Source:
public void onSuccess ( final com.google.gerrit.common.data.HostPageData result ) { com.google.gerrit.client.Gerrit.myConfig = result.config ; if ( ( result.account ) != null ) { com.google.gerrit.client.Gerrit.myAccount = result.account ; com.google.gerrit.client.added support ; com.google.gerrit.client.whitespace ignore ; com.google.gerrit.client.Gerrit.xsrfToken = result.xsrfToken ; } if ( ( result.accountDiffPref ) != null ) { com.google.gerrit.client.Gerrit.myAccountDiffPref = result.accountDiffPref ; BRANCH ( 63 ) ; com.google.gerrit.client.b2c Persisting ; diff ( preferences ) ; } onModuleLoad2 ( ) ; }

Target:
public void onSuccess ( final com.google.gerrit.common.data.HostPageData result ) { com.google.gerrit.client.Gerrit.myConfig = result.config ; if ( ( result.account ) != null ) { com.google.gerrit.client.Gerrit.myAccount = result.account ; com.google.gerrit.client.Gerrit.xsrfToken = result.xsrfToken ; } if ( ( result.accountDiffPref ) != null ) { com.google.gerrit.client.Gerrit.myAccountDiffPref = result.accountDiffPref ; } onModuleLoad2 ( ) ; }
Source:
void appendDelete ( int numLines ) { int origLineA = lineA ; lineA += numLines ; int aAheadOfB = ( lineA ) - ( lineB ) ; lineMapAtoB.add ( new com.google.gerrit.client.diff.LineMapper.LineGap ( origLineA , ( ( lineA ) - 1 ) , ( - aAheadOfB ) ) ) ; lineMapBtoA.add ( new com.google.gerrit.client.diff.LineMapper.LineGap ( lineB , lineB , aAheadOfB ) ) ; }

Target:
void appendDelete ( int numLines ) { int origLineA = lineA ; lineA += numLines ; int aAheadOfB = ( lineA ) - ( lineB ) ; lineMapAtoB.add ( new com.google.gerrit.client.diff.LineMapper.LineGap ( origLineA , ( ( lineA ) - 1 ) , ( - aAheadOfB ) ) ) ; lineMapBtoA.add ( new com.google.gerrit.client.diff.LineMapper.LineGap ( lineB , ( - 1 ) , aAheadOfB ) ) ; }
Source:
protected com.google.gerrit.server.change.ChangeJson.ChangeInfo getChange ( java.lang.String changeId , com.google.gerrit.common.changes.ListChangesOption ... options ) throws java.io.IOException { java.lang.String q = ( ( options.length ) > 0 ) ? "?o=" + ( com.google.common.base.Joiner.on ( "&o=" ) . join ( options ) ) : "" ; com.google.gerrit.acceptance.RestResponse r = session.get ( ( ( "/changes/" + changeId ) + q ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; return com.google.gerrit.acceptance.rest.change.AbstractSubmit.newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.change.ChangeJson.ChangeInfo.class ) ; }

Target:
protected com.google.gerrit.server.change.ChangeJson.ChangeInfo getChange ( java.lang.String changeId , com.google.gerrit.common.changes.ListChangesOption ... options ) throws java.io.IOException { java.lang.String q = ( ( options.length ) > 0 ) ? "?o=" + ( com.google.common.base.Joiner.on ( "&o=" ) . join ( options ) ) : "" ; com.google.gerrit.acceptance.RestResponse r = session.get ( ( ( "/changes/" + changeId ) + q ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; return newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.change.ChangeJson.ChangeInfo.class ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; Util.PROJECT_SVC.projectAccess ( getProjectKey ( ) , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.common.data.ProjectAccess > ( this ) { @ java.lang.Override public void preDisplay ( com.google.gerrit.common.data.ProjectAccess access ) { displayReadOnly ( access ) ; } } ) ; savedPanel = ACCESS ; }

Target:
public void preDisplay ( com.google.gerrit.common.data.ProjectAccess access ) { displayReadOnly ( access ) ; }
Source:
public void inheritRead_OverridesAndDeniesOfRef ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.deny ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCanAccess ( u ) ; assertCannotRead ( "refs/foobar" , u ) ; assertCannotRead ( "refs/tags/foobar" , u ) ; assertCanRead ( "refs/heads/foobar" , u ) ; }

Target:
public void inheritRead_OverridesAndDeniesOfRef ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.deny ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCanRead ( u ) ; assertCannotRead ( "refs/foobar" , u ) ; assertCannotRead ( "refs/tags/foobar" , u ) ; assertCanRead ( "refs/heads/foobar" , u ) ; }
Source:
public java.lang.String apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { com.google.gerrit.server.avatar.AvatarProvider impl = avatarProvider.get ( ) ; if ( impl == null ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } java.lang.String url = impl.getChangeAvatarUrl ( rsrc.getUser ( ) ) ; if ( com.google.common.base.Strings.isNullOrEmpty ( url ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } else { return url ; } }

Target:
public java.lang.String apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { com.google.gerrit.server.avatar.AvatarProvider impl = avatarProvider.get ( ) ; if ( impl == null ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } java.lang.String url = impl.getChangeAvatarUrl ( rsrc.getUser ( ) ) ; if ( com.google.common.base.Strings.isNullOrEmpty ( url ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } return url ; }
Source:
public void testReplaceSortKeyPredicate_NestedSortKey ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p ; p = parse ( "foo:a bar:b OR (foo:b bar:a AND sortkey_before:1234)" ) ; assertEquals ( parse ( "foo:a bar:b OR (foo:b bar:a sortkey_before:5678)" ) , com.google.gerrit.server.index.IndexedChangeQuery.replaceSortKeyPredicates ( p , "5678" ) ) ; p = parse ( "foo:a bar:b OR (foo:b bar:a AND sortkey_after:1234)" ) ; assertEquals ( parse ( "foo:a bar:b OR (foo:b bar:a sortkey_after:5678)" ) , com.google.gerrit.server.index.IndexedChangeQuery.replaceSortKeyPredicates ( p , "5678" ) ) ; }

Target:
public void testReplaceSortKeyPredicate_NestedSortKey ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p ; p = parse ( "foo:a bar:b OR (foo:b bar:a AND sortkey_before:1234)" ) ; org.junit.Assert.assertEquals ( parse ( "foo:a bar:b OR (foo:b bar:a sortkey_before:5678)" ) , com.google.gerrit.server.index.IndexedChangeQuery.replaceSortKeyPredicates ( p , "5678" ) ) ; p = parse ( "foo:a bar:b OR (foo:b bar:a AND sortkey_after:1234)" ) ; org.junit.Assert.assertEquals ( parse ( "foo:a bar:b OR (foo:b bar:a sortkey_after:5678)" ) , com.google.gerrit.server.index.IndexedChangeQuery.replaceSortKeyPredicates ( p , "5678" ) ) ; }
Source:
protected com.google.gerrit.common.data.PermissionRule block ( java.lang.String permission , com.google.gerrit.reviewdb.client.AccountGroup.UUID id , java.lang.String ref ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.common.data.PermissionRule rule = com.google.gerrit.server.project.Util.block ( cfg , permission , id , ref ) ; saveProjectConfig ( project , cfg ) ; return rule ; }

Target:
protected com.google.gerrit.common.data.PermissionRule block ( java.lang.String permission , com.google.gerrit.reviewdb.client.AccountGroup.UUID id , java.lang.String ref , com.google.gerrit.reviewdb.client.Project.NameKey project ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.common.data.PermissionRule rule = com.google.gerrit.server.project.Util.block ( cfg , permission , id , ref ) ; saveProjectConfig ( project , cfg ) ; return rule ; }
Source:
private com.google.gerrit.reviewdb.client.Account findAccount ( java.lang.String nameOrEmail ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.UnprocessableEntityException , com.google.gwtorm.server.OrmException { try { return accounts.get ( ) . parse ( nameOrEmail ) . getAccount ( ) ; } catch ( com.google.gerrit.extensions.restapi.UnprocessableEntityException e ) { switch ( authType ) { case HTTP_LDAP : case CLIENT_SSL_CERT_LDAP : case LDAP : if ( ( accountResolver.find ( nameOrEmail ) ) == null ) { return createAccountByLdap ( nameOrEmail ) ; } break ; default : } throw e ; } }

Target:
private com.google.gerrit.reviewdb.client.Account findAccount ( java.lang.String nameOrEmail ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.UnprocessableEntityException , com.google.gwtorm.server.OrmException { try { return accounts.get ( ) . parse ( nameOrEmail ) . getAccount ( ) ; } catch ( com.google.gerrit.extensions.restapi.UnprocessableEntityException e ) { switch ( authType ) { case HTTP_LDAP : case CLIENT_SSL_CERT_LDAP : case LDAP : if ( ( accountResolver.find ( nameOrEmail ) ) == null ) { com.google.gerrit.reviewdb.client.Account a = createAccountByLdap ( nameOrEmail ) ; if ( a != null ) { return a ; } } break ; default : } throw e ; } }
Source:
private void checkCreateCommit ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevCommit commit , com.google.gerrit.server.project.ProjectState projectState , com.google.gerrit.server.permissions.PermissionBackend.ForRef forRef ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException { try { forRef.check ( RefPermission.UPDATE ) ; return ; } catch ( com.google.gerrit.extensions.restapi.AuthException denied ) { } if ( reachable.fromHeadsOrTags ( projectState , repo , commit ) ) { return ; } throw new com.google.gerrit.extensions.restapi.AuthException ( java.lang.String.format ( "%s for creating new commit object not permitted" , RefPermission.UPDATE.describeForException ( ) ) ) ; }

Target:
private void checkCreateCommit ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevCommit commit , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.server.permissions.PermissionBackend.ForRef forRef ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException { try { forRef.check ( RefPermission.UPDATE ) ; return ; } catch ( com.google.gerrit.extensions.restapi.AuthException denied ) { } if ( reachable.fromHeadsOrTags ( project , repo , commit ) ) { return ; } throw new com.google.gerrit.extensions.restapi.AuthException ( java.lang.String.format ( "%s for creating new commit object not permitted" , RefPermission.UPDATE.describeForException ( ) ) ) ; }
Source:
public void run ( ) { try { final com.google.gerrit.server.mail.MergedSender cm = mergedSenderFactory.create ( result.change ) ; cm.setFrom ( currentUser.getAccountId ( ) ) ; cm.setPatchSet ( result.patchSet , result.info ) ; cm.send ( ) ; } catch ( com.google.gerrit.server.mail.EmailException e ) { final com.google.gerrit.reviewdb.client.PatchSet.Id psi = result.patchSet.getId ( ) ; com.google.gerrit.server.git.ReceiveCommits.log.error ( ( "Cannot send email for submitted patch set " + psi ) , e ) ; } }

Target:
public void run ( ) { try { final com.google.gerrit.server.mail.MergedSender cm = mergedSenderFactory.create ( result.change ) ; cm.setFrom ( currentUser.getAccountId ( ) ) ; cm.setPatchSet ( result.patchSet , result.info ) ; cm.send ( ) ; } catch ( java.lang.Exception e ) { final com.google.gerrit.reviewdb.client.PatchSet.Id psi = result.patchSet.getId ( ) ; com.google.gerrit.server.git.ReceiveCommits.log.error ( ( "Cannot send email for submitted patch set " + psi ) , e ) ; } }
Source:
public void listProjects ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey someProject = new com.google.gerrit.reviewdb.client.Project.NameKey ( "some-project" ) ; com.google.gerrit.acceptance.GitUtil.createProject ( sshSession , someProject.get ( ) ) ; com.google.gerrit.acceptance.RestResponse r = GET ( "/projects/" ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ProjectInfo > result = com.google.gerrit.acceptance.rest.project.ListProjectsIT.toProjectInfoMap ( r ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjects ( java.util.Arrays.asList ( allUsers , someProject , project ) , result.values ( ) ) ; }

Target:
public void listProjects ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey someProject = new com.google.gerrit.reviewdb.client.Project.NameKey ( "some-project" ) ; com.google.gerrit.acceptance.GitUtil.createProject ( sshSession , someProject.get ( ) ) ; com.google.gerrit.acceptance.RestResponse r = GET ( "/projects/" ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ProjectInfo > result = com.google.gerrit.acceptance.rest.project.ListProjectsIT.toProjectInfoMap ( r ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjects ( java.util.Arrays.asList ( allUsers , someProject , project ) , result.values ( ) ) ; }
Source:
protected void configure ( ) { factory ( RenameGroupOp.Factory.class ) ; factory ( MetaDataUpdate.InternalFactory.class ) ; bind ( MetaDataUpdate.Server.class ) ; bind ( com.google.gerrit.server.git.ReceiveConfig.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , org.eclipse.jgit.transport.PostUploadHook.class ) . to ( com.google.gerrit.server.git.UploadPackMetricsHook.class ) ; }

Target:
protected void configure ( ) { factory ( RenameGroupOp.Factory.class ) ; factory ( MetaDataUpdate.InternalFactory.class ) ; bind ( MetaDataUpdate.Server.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , org.eclipse.jgit.transport.PostUploadHook.class ) . to ( com.google.gerrit.server.git.UploadPackMetricsHook.class ) ; }
Source:
protected void configureServlets ( ) { rpc ( com.google.gerrit.server.rpc.AccountServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.AccountSecurityImpl.class ) ; rpc ( com.google.gerrit.server.rpc.GroupAdminServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ChangeListServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ChangeManageServiceImpl.class ) ; rpc ( com.google.gerrit.server.patch.PatchDetailServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ProjectAdminServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SuggestServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SystemInfoServiceImpl.class ) ; install ( new com.google.gerrit.server.rpc.changedetail.ChangeDetailModule ( ) ) ; }

Target:
protected void configureServlets ( ) { rpc ( com.google.gerrit.server.rpc.AccountServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.AccountSecurityImpl.class ) ; rpc ( com.google.gerrit.server.rpc.GroupAdminServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ChangeListServiceImpl.class ) ; rpc ( com.google.gerrit.server.patch.PatchDetailServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ProjectAdminServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SuggestServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SystemInfoServiceImpl.class ) ; install ( new com.google.gerrit.server.rpc.changedetail.ChangeDetailModule ( ) ) ; }
Source:
public com.google.gwtorm.server.ResultSet < E > get ( final java.lang.Iterable < K > keys ) throws com.google.gwtorm.server.OrmException { final java.util.ArrayList < E > r = new java.util.ArrayList < E > ( ) ; for ( final K key : keys ) { final E o = get ( key ) ; if ( o != null ) { r.add ( o ) ; } } return new com.google.gwtorm.server.ListResultSet < E > ( r ) ; }

Target:
public com.google.gwtorm.server.ResultSet < E > get ( final java.lang.Iterable < K > keys ) throws com.google.gwtorm.server.OrmException { final java.util.ArrayList < E > r = new java.util.ArrayList < > ( ) ; for ( final K key : keys ) { final E o = get ( key ) ; if ( o != null ) { r.add ( o ) ; } } return new com.google.gwtorm.server.ListResultSet ( r ) ; }
Source:
public com.google.common.collect.Multimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Change.Id > changesByProject ( ) throws com.google.gwtorm.server.OrmException { com.google.common.collect.ListMultimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Change.Id > ret = com.google.common.collect.ArrayListMultimap.create ( ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : changeData ) { ret.put ( cd.change ( ) . getProject ( ) , cd.getId ( ) ) ; } return ret ; }

Target:
public com.google.common.collect.Multimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Change.Id > changesByProject ( ) throws com.google.gwtorm.server.OrmException { com.google.common.collect.ListMultimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Change.Id > ret = com.google.common.collect.ArrayListMultimap.create ( ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : changeData.values ( ) ) { ret.put ( cd.change ( ) . getProject ( ) , cd.getId ( ) ) ; } return ret ; }
Source:
public com.google.common.util.concurrent.ListenableFuture < java.util.List < java.lang.Void > > apply ( java.util.List < com.google.gerrit.reviewdb.client.Change > changes ) { java.util.List < com.google.common.util.concurrent.ListenableFuture < java.lang.Void > > result = com.google.common.collect.Lists.newArrayListWithCapacity ( changes.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Change c : changes ) { result.add ( executor.submit ( new com.google.gerrit.server.index.ReindexAfterUpdate.Index ( event , c.getOwner ( ) , c.getId ( ) ) ) ) ; } return com.google.common.util.concurrent.Futures.allAsList ( result ) ; }

Target:
public com.google.common.util.concurrent.ListenableFuture < java.util.List < java.lang.Void > > apply ( java.util.List < com.google.gerrit.reviewdb.client.Change > changes ) { java.util.List < com.google.common.util.concurrent.ListenableFuture < java.lang.Void > > result = com.google.common.collect.Lists.newArrayListWithCapacity ( changes.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Change c : changes ) { result.add ( executor.submit ( new com.google.gerrit.server.index.ReindexAfterUpdate.Index ( event , c.getId ( ) ) ) ) ; } return com.google.common.util.concurrent.Futures.allAsList ( result ) ; }
Source:
private void setMissingHeader ( final java.util.Map < java.lang.String , com.google.gerrit.server.mail.send.EmailHeader > hdrs , final java.lang.String name , final java.lang.String value ) { if ( ( ! ( hdrs.containsKey ( name ) ) ) || ( hdrs.get ( name ) . isEmpty ( ) ) ) { hdrs.put ( name , new com.google.gerrit.server.mail.send.EmailHeader.String ( value ) ) ; } }

Target:
private static void setMissingHeader ( java.util.Map < java.lang.String , com.google.gerrit.server.mail.send.EmailHeader > hdrs , java.lang.String name , java.lang.String value ) { if ( ( ! ( hdrs.containsKey ( name ) ) ) || ( hdrs.get ( name ) . isEmpty ( ) ) ) { hdrs.put ( name , new com.google.gerrit.server.mail.send.EmailHeader.String ( value ) ) ; } }
Source:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.account.AccountResource rsrc , com.google.gerrit.server.account.StarredChanges.EmptyInput in ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gwtorm.server.OrmException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "not allowed to add starred change" ) ; } try { starredChangesUtil.star ( self.get ( ) . getAccountId ( ) , change.getId ( ) ) ; } catch ( com.google.gwtorm.server.OrmDuplicateKeyException e ) { return com.google.gerrit.extensions.restapi.Response.none ( ) ; } return com.google.gerrit.extensions.restapi.Response.none ( ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.account.AccountResource rsrc , com.google.gerrit.server.account.StarredChanges.EmptyInput in ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "not allowed to add starred change" ) ; } try { starredChangesUtil.star ( self.get ( ) . getAccountId ( ) , change.getProject ( ) , change.getId ( ) ) ; } catch ( com.google.gwtorm.server.OrmDuplicateKeyException e ) { return com.google.gerrit.extensions.restapi.Response.none ( ) ; } return com.google.gerrit.extensions.restapi.Response.none ( ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; if ( ( regFocus ) == null ) { regFocus = com.google.gwtexpui.globalkey.client.GlobalKey.addApplication ( new com.google.gwtexpui.globalkey.client.KeyCommand ( 0 , '/' , Gerrit.C.keySearch ( ) ) { @ java.lang.Override public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { event.preventDefault ( ) ; searchBox.setFocus ( true ) ; searchBox.selectAll ( ) ; } } ) ; } }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; if ( ( regFocus ) == null ) { regFocus = com.google.gwtexpui.globalkey.client.GlobalKey.addApplication ( this , new com.google.gwtexpui.globalkey.client.KeyCommand ( 0 , '/' , Gerrit.C.keySearch ( ) ) { @ java.lang.Override public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { event.preventDefault ( ) ; searchBox.setFocus ( true ) ; searchBox.selectAll ( ) ; } } ) ; } }
Source:
public void testParentString ( ) { final com.google.gwtorm.client.IntKeyTestCase.Parent p1 = new com.google.gwtorm.client.IntKeyTestCase.Parent ( 1 ) ; assertEquals ( "1" , p1.toString ( ) ) ; final com.google.gwtorm.client.IntKeyTestCase.Parent p2 = new com.google.gwtorm.client.IntKeyTestCase.Parent ( 0 ) ; p2.fromString ( p1.toString ( ) ) ; assertEquals ( p1 , p2 ) ; }

Target:
public void testParentString ( ) { final com.google.gwtorm.client.IntKeyTestCase.Parent p1 = new com.google.gwtorm.client.IntKeyTestCase.Parent ( 1 ) ; org.junit.Assert.assertEquals ( "1" , p1.toString ( ) ) ; final com.google.gwtorm.client.IntKeyTestCase.Parent p2 = new com.google.gwtorm.client.IntKeyTestCase.Parent ( 0 ) ; p2.fromString ( p1.toString ( ) ) ; org.junit.Assert.assertEquals ( p1 , p2 ) ; }
Source:
private static java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > commits ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema , java.util.List < java.lang.String > hashes ) { java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > commits = new java.util.ArrayList < > ( hashes.size ( ) ) ; for ( java.lang.String s : hashes ) { commits.add ( com.google.gerrit.server.query.change.InternalChangeQuery.commit ( schema , s ) ) ; } return commits ; }

Target:
private static java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > commits ( java.util.List < java.lang.String > hashes ) { java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > commits = new java.util.ArrayList < > ( hashes.size ( ) ) ; for ( java.lang.String s : hashes ) { commits.add ( com.google.gerrit.server.query.change.InternalChangeQuery.commit ( s ) ) ; } return commits ; }
Source:
void setText ( final java.lang.String query ) { if ( ( query == null ) || ( query.equals ( "" ) ) ) { searchBox.setText ( Gerrit.C.searchHint ( ) ) ; searchBox.addStyleName ( Gerrit.RESOURCES.css ( ) . inputFieldTypeHint ( ) ) ; } else { searchBox.setText ( query ) ; searchBox.removeStyleName ( Gerrit.RESOURCES.css ( ) . inputFieldTypeHint ( ) ) ; } }

Target:
void setText ( final java.lang.String query ) { searchBox.setText ( query ) ; }
Source:
private void updateSubscriptions ( ) throws com.google.gerrit.server.git.MergeException { if ( ( ( mergeTip ) != null ) && ( ( ( branchTip ) == null ) || ( ( branchTip ) != ( mergeTip ) ) ) ) { com.google.gerrit.server.git.SubmoduleOp subOp = subOpFactory.create ( destBranch , mergeTip , rw , db , destProject , submitted , commits ) ; try { subOp.update ( ) ; } catch ( com.google.gerrit.server.git.SubmoduleException e ) { com.google.gerrit.server.git.MergeOp.log.error ( ( "The gitLinks were not updated according to the subscriptions " + ( e.getMessage ( ) ) ) ) ; } } }

Target:
private void updateSubscriptions ( ) { if ( ( ( mergeTip ) != null ) && ( ( ( branchTip ) == null ) || ( ( branchTip ) != ( mergeTip ) ) ) ) { com.google.gerrit.server.git.SubmoduleOp subOp = subOpFactory.create ( destBranch , mergeTip , rw , repo , destProject , submitted , commits ) ; try { subOp.update ( ) ; } catch ( com.google.gerrit.server.git.SubmoduleException e ) { com.google.gerrit.server.git.MergeOp.log.error ( ( "The gitLinks were not updated according to the subscriptions " + ( e.getMessage ( ) ) ) ) ; } } }
Source:
private void enable ( boolean enabled ) { commitMessage.setEnabled ( enabled ) ; commit.setEnabled ( ( enabled && ( ! ( access.getOwnerOf ( ) . isEmpty ( ) ) ) ) ) ; review.setEnabled ( ( enabled ? access.canUpload ( ) : false ) ) ; cancel1.setEnabled ( enabled ) ; cancel2.setEnabled ( enabled ) ; }

Target:
private void enable ( boolean enabled ) { commitMessage.setEnabled ( enabled ) ; commit.setEnabled ( ( enabled && ( ! ( access.getOwnerOf ( ) . isEmpty ( ) ) ) ) ) ; review.setEnabled ( ( enabled && ( access.canUpload ( ) ) ) ) ; cancel1.setEnabled ( enabled ) ; cancel2.setEnabled ( enabled ) ; }
Source:
private com.google.gerrit.server.git.MergeOpRepoManager.OpenRepo getRepo ( com.google.gerrit.reviewdb.client.Project.NameKey project ) throws java.io.IOException { if ( ( orm ) == null ) { orm = repoManagerProvider.get ( ) ; closeOrm = true ; } try { com.google.gerrit.server.git.MergeOpRepoManager.OpenRepo or = orm.openRepo ( project ) ; com.google.common.base.Preconditions.checkState ( or.rw.hasRevSort ( RevSort.TOPO ) ) ; return or ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new java.io.IOException ( e ) ; } }

Target:
private com.google.gerrit.server.git.MergeOpRepoManager.OpenRepo getRepo ( com.google.gerrit.reviewdb.client.Project.NameKey project ) throws java.io.IOException { if ( ( orm ) == null ) { orm = repoManagerProvider.get ( ) ; closeOrm = true ; } try { com.google.gerrit.server.git.MergeOpRepoManager.OpenRepo or = orm.getRepo ( project ) ; com.google.common.base.Preconditions.checkState ( or.rw.hasRevSort ( RevSort.TOPO ) ) ; return or ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new java.io.IOException ( e ) ; } }
Source:
private com.google.gerrit.reviewdb.client.Change retrieveChange ( java.lang.String ref , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet.Id id = PatchSet.Id.fromRef ( ref ) ; com.google.gerrit.reviewdb.client.Change change = db.changes ( ) . get ( id.getParentKey ( ) ) ; if ( change == null ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( id.getParentKey ( ) ) ; } return change ; }

Target:
private com.google.gerrit.reviewdb.client.Change retrieveChange ( java.lang.String ref , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet.Id id = PatchSet.Id.fromRef ( ref ) ; com.google.gerrit.reviewdb.client.Change change = db.changes ( ) . get ( id.getParentKey ( ) ) ; return change ; }