Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Diagram refresh problem(GMFHelper.getGraphicalEditPart(...) method weird implementation)
Diagram refresh problem [message #1724545] Wed, 24 February 2016 14:43 Go to next message
Adam Lengyel is currently offline Adam LengyelFriend
Messages: 8
Registered: October 2014
Junior Member
Hi,

During a debugging phase I found the fallowings:
- plugin: org.eclipse.sirius.diagram.ui (3.1.2.201511030845)
- package: org.eclipse.sirius.diagram.ui.internal.refresh
- class: GMFHelper
- method: getGraphicalEditPart(View)

In this method please check this part (line 646-648):
if (dialectEditor instanceof DiagramEditor && ((DiagramEditor) editor).getDiagram() != diagram) {
diagramEditor = (DiagramEditor) dialectEditor;
}


Maybe instead of editor, you should use dialectEditor and instead of != you should use ==, like below:
if (dialectEditor instanceof DiagramEditor && ((DiagramEditor) dialectEditor).getDiagram() == diagram) {
diagramEditor = (DiagramEditor) dialectEditor;
}


I ran into a situation, where editor contained a non DiagramEditor instance, and in that case the line 646 led to a ClassCastException.

Thanks,
Adam
Re: Diagram refresh problem [message #1725148 is a reply to message #1724545] Tue, 01 March 2016 09:27 Go to previous message
Laurent Fasani is currently offline Laurent FasaniFriend
Messages: 174
Registered: October 2014
Senior Member
Hi,

Thanks Adam for that submission.
Could you please raise a bug in sirius so that this issue is handle
correctly.
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Sirius

Regards
Laurent

Le 24/02/2016 15:43, Adam Lengyel a écrit :
> Hi,
>
> During a debugging phase I found the fallowings:
> - plugin: org.eclipse.sirius.diagram.ui (3.1.2.201511030845)
> - package: org.eclipse.sirius.diagram.ui.internal.refresh
> - class: GMFHelper
> - method: getGraphicalEditPart(View)
>
> In this method please check this part (line 646-648):
> if (dialectEditor instanceof DiagramEditor && ((DiagramEditor)
> editor).getDiagram() != diagram) {
> diagramEditor = (DiagramEditor) dialectEditor;
> }
>
> Maybe instead of editor, you should use dialectEditor and instead of !=
> you should use ==, like below:
> if (dialectEditor instanceof DiagramEditor && ((DiagramEditor)
> dialectEditor).getDiagram() == diagram) {
> diagramEditor = (DiagramEditor) dialectEditor;
> }
>
> I ran into a situation, where editor contained a non DiagramEditor
> instance, and in that case the line 646 led to a ClassCastException.
>
> Thanks,
> Adam


Laurent Fasani - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Can man edit DDiagram programmatically?
Next Topic:Resource reloading
Goto Forum:
  


Current Time: Thu Jan 21 08:50:35 GMT 2021

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

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

Back to the top