|Re: NPE in Sapphire code while switching from Source to Design tab & back [message #1578794 is a reply to message #1575399]
||Thu, 22 January 2015 16:17
| Dmitry Karpenko
Registered: January 2015
Reproduced it on "clean" Sapphire & workspace - checked out Sapphire source from the Git repo, Launched it with Luna as a target platform, created Java project & catalog.xml file into it, opened this file with Sapphire editor from Samples project, added some content (please see the linked screenshot)|
Ater that - made Outline view inactive (put Problems view on top of it), made Source tab active in the editor (as described in the scenario above), restarted Eclipse.
After restarting scanario from Comment 1 gives NPE
Then I activated Outline, closed editor & restarted Eclipse. Opened editor & retried initial scenario. No NPE seen.
In further description all fields & methods belong to SapphireEditorContentOutline class.
Debugged it a bit & now the problem seems to be the following - when Outline view is present but not initially active - createControl(Composite parent) isn't yet called, so pageBook == null when calling refresh(). Because of that, first call of refresh() makes currentPage not null, but returns before registering page site in line 207.
Second call to refresh() causes NPE because of non-consistent state of pageToPageSite
(Size: 66.70KB, Downloaded 408 times)
Powered by FUDForum
. Page generated in 0.01735 seconds