Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Sapphire » NPE in Sapphire code while switching from Source to Design tab & back
NPE in Sapphire code while switching from Source to Design tab & back [message #1575059] Tue, 20 January 2015 15:56 Go to next message
Dmitry Karpenko is currently offline Dmitry KarpenkoFriend
Messages: 4
Registered: January 2015
Junior Member
Hi Guys,
I've faced a following problem:
1. Open Sapphire editor. If it opened on the Design tab, switch it to the Source tab, close & reopen - editor should be on the Source tab initially
2. Switch to the Design Tab
3. Switch back to the Source tab

After that, NPE could be seen in the Error Log:

java.lang.NullPointerException
at org.eclipse.sapphire.ui.internal.SapphireEditorContentOutline.refresh(SapphireEditorContentOutline.java:188)
at org.eclipse.sapphire.ui.SapphireEditor.pageChange(SapphireEditor.java:570)
at org.eclipse.ui.part.MultiPageEditorPart$2.widgetSelected(MultiPageEditorPart.java:294)

It seems that refresh() code tries to get site for currentPage, but this site isn't there while trying described scenario. Am I doing smth wrong?

Best Regards, Dmitry
  • Attachment: log.txt
    (Size: 3.26KB, Downloaded 255 times)
Re: NPE in Sapphire code while switching from Source to Design tab & back [message #1575399 is a reply to message #1575059] Tue, 20 January 2015 20:11 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
This seems to be the following bug:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=433160

At the time, we couldn't repro it again or explain what is going on. If you are able to repro this consistently or semi-consistently, try to figure out the circumstances that trigger it and/or debug the issue. The simple repro you've outlined doesn't repro for me.
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 Go to previous messageGo to next message
Dmitry Karpenko is currently offline Dmitry KarpenkoFriend
Messages: 4
Registered: January 2015
Junior Member
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

Screenshot:
index.php/fa/20546/0/
  • Attachment: hoMJB0g.png
    (Size: 66.70KB, Downloaded 572 times)
Re: NPE in Sapphire code while switching from Source to Design tab & back [message #1588147 is a reply to message #1578794] Tue, 27 January 2015 19:38 Go to previous message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
Thanks for identifying the conditions under which the problem occurs and for providing the detailed analysis of what goes wrong.

Please verify the fix and mark the bug accordingly.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=433160
Previous Topic:Announcing Sapphire 8.1.1 Release
Next Topic:Announcing Sapphire 8.1.2 Release
Goto Forum:
  


Current Time: Fri Dec 13 08:13:45 GMT 2024

Powered by FUDForum. Page generated in 0.03021 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top