Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 365797

Summary: ReportMultiBookPage creates outline pages instead of letting the framework do it
Product: z_Archived Reporter: Remy Suen <remy.suen>
Component: BIRTAssignee: Dazheng Gao <gump_gao>
Status: NEW --- QA Contact: Xiaoying Gu <bluesoldier>
Severity: normal    
Priority: P3 CC: bluesoldier, daniel_megert, gump_gao, zqian
Version: 3.7.1   
Target Milestone: Future   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
patch none

Description Remy Suen CLA 2011-12-06 14:24:20 EST
java.lang.StackOverflowError
	at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2439)
	at org.eclipse.swt.widgets.Tree.callWindowProc(Tree.java:1534)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4623)
	at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:5939)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4972)
	at org.eclipse.swt.internal.win32.OS.SendMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.SendMessage(OS.java:3384)
	at org.eclipse.swt.widgets.Tree.createItem(Tree.java:2104)
	at org.eclipse.swt.widgets.TreeItem.<init>(TreeItem.java:203)
	at org.eclipse.swt.widgets.TreeItem.<init>(TreeItem.java:91)
	at org.eclipse.jface.viewers.TreeViewer.createNewRowPart(TreeViewer.java:809)
	at org.eclipse.jface.viewers.TreeViewer.newItem(TreeViewer.java:315)
	at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:839)
	at org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractTreeViewer.java:815)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:789)
	at org.eclipse.jface.viewers.TreeViewer.createChildren(TreeViewer.java:644)
	at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:760)
	at org.eclipse.jface.viewers.AbstractTreeViewer.internalInitializeTree(AbstractTreeViewer.java:1540)
	at org.eclipse.jface.viewers.TreeViewer.internalInitializeTree(TreeViewer.java:833)
	at org.eclipse.jface.viewers.AbstractTreeViewer$5.run(AbstractTreeViewer.java:1524)
	at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1443)
	at org.eclipse.jface.viewers.TreeViewer.preservingSelection(TreeViewer.java:403)
	at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1404)
	at org.eclipse.jface.viewers.AbstractTreeViewer.inputChanged(AbstractTreeViewer.java:1517)
	at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:280)
	at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1690)
	at org.eclipse.birt.report.designer.internal.ui.views.outline.DesignerOutlinePage.setTreeInput(DesignerOutlinePage.java:514)
	at org.eclipse.birt.report.designer.internal.ui.views.outline.DesignerOutlinePage.init(DesignerOutlinePage.java:506)
	at org.eclipse.birt.report.designer.internal.ui.views.outline.DesignerOutlinePage.createControl(DesignerOutlinePage.java:145)
	at org.eclipse.birt.report.designer.internal.ui.editors.schematic.ReportMultiBookPage.setActivePage(ReportMultiBookPage.java:240)
	at org.eclipse.birt.report.designer.ui.editors.MultiPageReportEditor.updateOutLineView(MultiPageReportEditor.java:694)
	at org.eclipse.birt.report.designer.ui.editors.MultiPageReportEditor.getAdapter(MultiPageReportEditor.java:625)
	at org.eclipse.birt.report.designer.ui.editors.IDEMultiPageReportEditor.getAdapter(IDEMultiPageReportEditor.java:505)
	at org.eclipse.birt.report.designer.ui.editors.ReportEditorProxy.getAdapter(ReportEditorProxy.java:210)
	at org.eclipse.wst.sse.ui.internal.CustomFilterPropertyTester.test(CustomFilterPropertyTester.java:27)
	at org.eclipse.core.internal.expressions.Property.test(Property.java:58)
	at org.eclipse.core.internal.expressions.TestExpression.evaluate(TestExpression.java:99)
	at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
	at org.eclipse.core.internal.expressions.WithExpression.evaluate(WithExpression.java:72)
	at org.eclipse.e4.ui.internal.workbench.ContributionsAnalyzer.isVisible(ContributionsAnalyzer.java:236)
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributionRecord.computeVisibility(ContributionRecord.java:110)
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributionRecord.updateVisibility(ContributionRecord.java:59)
	at org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer$6.changed(MenuManagerRenderer.java:447)
	at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:109)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:298)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:312)
	at org.eclipse.ui.internal.handlers.LegacyHandlerService.addHandlerActivation(LegacyHandlerService.java:226)
	at org.eclipse.ui.internal.handlers.LegacyHandlerService.registerLegacyHandler(LegacyHandlerService.java:210)
	at org.eclipse.ui.internal.handlers.LegacyHandlerService.activateHandler(LegacyHandlerService.java:352)
	at org.eclipse.ui.internal.handlers.LegacyHandlerService.activateHandler(LegacyHandlerService.java:333)
	at org.eclipse.ui.SubActionBars.setGlobalActionHandler(SubActionBars.java:555)
	at org.eclipse.birt.report.designer.internal.ui.views.outline.DesignerOutlinePage.handleGlobalAction(DesignerOutlinePage.java:545)
	at org.eclipse.birt.report.designer.internal.ui.views.outline.DesignerOutlinePage.init(DesignerOutlinePage.java:509)
	at org.eclipse.birt.report.designer.internal.ui.views.outline.DesignerOutlinePage.createControl(DesignerOutlinePage.java:145)
	at org.eclipse.birt.report.designer.internal.ui.editors.schematic.ReportMultiBookPage.setActivePage(ReportMultiBookPage.java:240)
	at org.eclipse.birt.report.designer.ui.editors.MultiPageReportEditor.updateOutLineView(MultiPageReportEditor.java:694)
	at org.eclipse.birt.report.designer.ui.editors.MultiPageReportEditor.getAdapter(MultiPageReportEditor.java:625)
	at org.eclipse.birt.report.designer.ui.editors.IDEMultiPageReportEditor.getAdapter(IDEMultiPageReportEditor.java:505)
	at org.eclipse.birt.report.designer.ui.editors.ReportEditorProxy.getAdapter(ReportEditorProxy.java:210)
	at org.eclipse.wst.sse.ui.internal.CustomFilterPropertyTester.test(CustomFilterPropertyTester.java:27)
	at org.eclipse.core.internal.expressions.Property.test(Property.java:58)
	at org.eclipse.core.internal.expressions.TestExpression.evaluate(TestExpression.java:99)
	at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
	at org.eclipse.core.internal.expressions.WithExpression.evaluate(WithExpression.java:72)
	at org.eclipse.e4.ui.internal.workbench.ContributionsAnalyzer.isVisible(ContributionsAnalyzer.java:236)
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributionRecord.computeVisibility(ContributionRecord.java:110)
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributionRecord.updateVisibility(ContributionRecord.java:59)
	at org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer$6.changed(MenuManagerRenderer.java:447)
	at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:109)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:298)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:312)
	at org.eclipse.ui.internal.handlers.LegacyHandlerService.addHandlerActivation(LegacyHandlerService.java:226)
	at org.eclipse.ui.internal.handlers.LegacyHandlerService.registerLegacyHandler(LegacyHandlerService.java:210)
	at org.eclipse.ui.internal.handlers.LegacyHandlerService.activateHandler(LegacyHandlerService.java:352)
	at org.eclipse.ui.internal.handlers.LegacyHandlerService.activateHandler(LegacyHandlerService.java:333)
	at org.eclipse.ui.SubActionBars.setGlobalActionHandler(SubActionBars.java:555)
	at org.eclipse.birt.report.designer.internal.ui.views.outline.DesignerOutlinePage.handleGlobalAction(DesignerOutlinePage.java:545)
	at org.eclipse.birt.report.designer.internal.ui.views.outline.DesignerOutlinePage.init(DesignerOutlinePage.java:509)
	at org.eclipse.birt.report.designer.internal.ui.views.outline.DesignerOutlinePage.createControl(DesignerOutlinePage.java:145)
	at org.eclipse.birt.report.designer.internal.ui.editors.schematic.ReportMultiBookPage.setActivePage(ReportMultiBookPage.java:240)
	at org.eclipse.birt.report.designer.ui.editors.MultiPageReportEditor.updateOutLineView(MultiPageReportEditor.java:694)
	at org.eclipse.birt.report.designer.ui.editors.MultiPageReportEditor.getAdapter(MultiPageReportEditor.java:625)
	at org.eclipse.birt.report.designer.ui.editors.IDEMultiPageReportEditor.getAdapter(IDEMultiPageReportEditor.java:505)
	at org.eclipse.birt.report.designer.ui.editors.ReportEditorProxy.getAdapter(ReportEditorProxy.java:210)
	at org.eclipse.wst.sse.ui.internal.CustomFilterPropertyTester.test(CustomFilterPropertyTester.java:27)
Comment 1 Remy Suen CLA 2011-12-07 11:24:22 EST
Downgrading severity since the changes for bug 319621 have been reverted.
Comment 2 Remy Suen CLA 2012-01-04 13:07:19 EST
Why is it that ReportMultiBookPage create the outline page's controls explicitly in its setActivePage(IPageBookViewPage) method?

-----------

Access to a content outline page begins when an editor is activated. When activation occurs, the content outline view will ask the editor for its content outline page. This is done by invoking getAdapter(IContentOutlinePage.class) on the editor. If the editor returns a page, the view then creates the controls for that page (using createControl) and makes the page visible.

-----------

Per the API spec'd in IContentOutlinePage, the 'Outline' view itself will handle the creation of the page's controls. BIRT should not be doing this themselves.
Comment 3 Remy Suen CLA 2012-01-09 16:09:35 EST
Could someone from the BIRT team please address comment 2? This defect will prevent the report design editor from functioning when running on top of the Eclipse 4 SDK.
Comment 4 Zhiqiang Qian CLA 2012-01-09 20:04:17 EST
(In reply to comment #3)
> Could someone from the BIRT team please address comment 2? This defect will
> prevent the report design editor from functioning when running on top of the
> Eclipse 4 SDK.

We'll take a look.
Comment 5 Eric Moffatt CLA 2012-01-30 15:02:12 EST
Ping ! we're in M6 now, is there any update on this ?
Comment 6 Zhiqiang Qian CLA 2012-01-31 04:35:01 EST
How can I reproduce this in Eclipse 4.2M5 + BIRT 3.7.1? I suspect this was already fixed in latest 3.7.2 code, but cannot verify it without the detailed steps.
Comment 7 Remy Suen CLA 2012-01-31 07:54:32 EST
(In reply to comment #6)
> How can I reproduce this in Eclipse 4.2M5 + BIRT 3.7.1?

You can't reproduce the problem unless you apply the patch from bug 319621.

> I suspect this was
> already fixed in latest 3.7.2 code, but cannot verify it without the detailed
> steps.

I'm not so sure about that. ReportMultiBookPage is still manually creating the control in line 240.
http://git.eclipse.org/c/birt/org.eclipse.birt.git/tree/UI/org.eclipse.birt.report.designer.ui.editors/src/org/eclipse/birt/report/designer/internal/ui/editors/schematic/ReportMultiBookPage.java
Comment 8 Zhiqiang Qian CLA 2012-01-31 21:15:23 EST
(In reply to comment #7)
> You can't reproduce the problem unless you apply the patch from bug 319621.
> 

Can you attach the compiled java class file for the related patched code against 4.2M5? So I can simply replace the files in the jars for testing.

> I'm not so sure about that. ReportMultiBookPage is still manually creating the
> control in line 240.
> http://git.eclipse.org/c/birt/org.eclipse.birt.git/tree/UI/org.eclipse.birt.report.designer.ui.editors/src/org/eclipse/birt/report/designer/internal/ui/editors/schematic/ReportMultiBookPage.java

The root cause is the recursive call of the update action nested in the getAdapter() impl, our previous fix has added the check to simply discard those unnecessary update actions.
Comment 9 Remy Suen CLA 2012-01-31 21:29:20 EST
(In reply to comment #8)
> The root cause is the recursive call of the update action nested in the
> getAdapter() impl, our previous fix has added the check to simply discard those
> unnecessary update actions.

I guess you're referring to f3525073d448f21435c283bb83e93d00eaf3217e.
http://git.eclipse.org/c/birt/org.eclipse.birt.git/commit/?id=f3525073d448f21435c283bb83e93d00eaf3217e

Is BIRT 3.7.2 not being contributed to Juno? Only 3.7.1 shows up from the Juno update site.

I guess a manual installation is required.
http://download.eclipse.org/birt/downloads/build.php?build=M-R1-3.7.2RC1-201201171144
Comment 10 Zhiqiang Qian CLA 2012-01-31 21:39:59 EST
Created attachment 210350 [details]
patch

(In reply to comment #9)
> I guess you're referring to f3525073d448f21435c283bb83e93d00eaf3217e.
> http://git.eclipse.org/c/birt/org.eclipse.birt.git/commit/?id=f3525073d448f21435c283bb83e93d00eaf3217e
> 

Yes.

> Is BIRT 3.7.2 not being contributed to Juno? Only 3.7.1 shows up from the Juno
> update site.
> 
> I guess a manual installation is required.
> http://download.eclipse.org/birt/downloads/build.php?build=M-R1-3.7.2RC1-201201171144

The Juno update site still has BIRT 3.7.1. I've attached the patched class files for org.eclipse.birt.report.designer.ui.editors/src/org/eclipse/birt/report/designer/ui/editors/MultiPageReportEditor, you can replace them for the 3.7.1 jars for testing.
Comment 11 Remy Suen CLA 2012-02-01 08:23:01 EST
I can confirm that the problem goes away with the birt-updatesite-3.7.2RC1.zip though would still recommend you investigate why you need to explicitly create the controls of an outline page yourself.
Comment 12 Zhiqiang Qian CLA 2012-02-02 01:35:42 EST
(In reply to comment #11)
> I can confirm that the problem goes away with the birt-updatesite-3.7.2RC1.zip
> though would still recommend you investigate why you need to explicitly create
> the controls of an outline page yourself.

Glad to know it works. Yes, we'll try refactoring the code in the future.