Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 Tools » Casting ISelection-Content to PackageEditPart resolves in VM-Crash
Casting ISelection-Content to PackageEditPart resolves in VM-Crash [message #476380] Mon, 27 April 2009 13:55 Go to next message
teddyclaw is currently offline teddyclaw
Messages: 9
Registered: July 2009
Junior Member
hello.

i am currently trying to connect generated model refactorings from the
emft project to the graphical editor of the uml2tools. it seemed simple
since i only have to take the selected EditPart, "extract" the model
element which is needed by the refactoring and start the refactoring with
the extracted model element.

BUT: somehow whenever i take the EditPart (in this case the
PackageEditPart) out of the given ISelection and try to cast the Object to
its actual Class (code snippet to follow) i end up with the VM stopping
with an unexpected error. What i am trying to to is the following:


@Override
public void run(IAction action) {
StructuredSelection s = (StructuredSelection) selection;
PackageEditPart pEP = null;
Object o = s.getFirstElement();
if(o instanceof PackageEditPart) //VM reports unexpected error here
pEP = (PackageEditPart)o; //or here if I delete the line above
org.eclipse.uml2.uml.Package p =
(org.eclipse.uml2.uml.Package)pEP.resolveSemanticElement();

org.eclipse.uml2.uml.Package selectedEObject = p;

RefactoringWizard wizard = new RefactoringWizard(selectedEObject);

the debugger shows, that the selection contains only one object which is a
PackageEditPart, however, instanceof checks and casts dont work an instead
the VM crashes with the following statement:

An unexpected error has been detected by Java Runtime Environment:
#
# Internal Error (constantPoolOop.cpp:67), pid=948, tid=2512
# Error: guarantee(error != (symbolOop)0,"tag mismatch with resolution
error table")
#
# Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode windows-x86)
# An error report file with more information is saved as:
# C:\Users\tdc\AppData\Local\Temp\hs_err_pid948.log

thanks for the help
matt
Re: Casting ISelection-Content to PackageEditPart resolves in VM-Crash [message #476381 is a reply to message #476380] Tue, 28 April 2009 10:40 Go to previous message
Tatiana Fesenko is currently offline Tatiana Fesenko
Messages: 530
Registered: July 2009
Senior Member
Hello Matt,

Does the problem repeat after restarting Eclipse? If it still does, what
arguments do you pass to your virtual machine?

Best wishes,
Tanya.

> hello.
>
> i am currently trying to connect generated model refactorings from the
> emft project to the graphical editor of the uml2tools. it seemed
> simple since i only have to take the selected EditPart, "extract" the
> model element which is needed by the refactoring and start the
> refactoring with the extracted model element.
>
> BUT: somehow whenever i take the EditPart (in this case the
> PackageEditPart) out of the given ISelection and try to cast the
> Object to its actual Class (code snippet to follow) i end up with the
> VM stopping with an unexpected error. What i am trying to to is the
> following:
>
> @Override
> public void run(IAction action) {
> StructuredSelection s = (StructuredSelection) selection;
> PackageEditPart pEP = null;
> Object o = s.getFirstElement();
> if(o instanceof PackageEditPart) //VM reports unexpected error here
> pEP = (PackageEditPart)o; //or here if I delete the line above
> org.eclipse.uml2.uml.Package p =
> (org.eclipse.uml2.uml.Package)pEP.resolveSemanticElement();
> org.eclipse.uml2.uml.Package selectedEObject = p;
>
> RefactoringWizard wizard = new RefactoringWizard(selectedEObject);
>
> the debugger shows, that the selection contains only one object which
> is a PackageEditPart, however, instanceof checks and casts dont work
> an instead the VM crashes with the following statement:
>
> An unexpected error has been detected by Java Runtime Environment:
> #
> # Internal Error (constantPoolOop.cpp:67), pid=948, tid=2512
> # Error: guarantee(error != (symbolOop)0,"tag mismatch with
> resolution
> error table")
> #
> # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode
> windows-x86)
> # An error report file with more information is saved as:
> # C:\Users\tdc\AppData\Local\Temp\hs_err_pid948.log
> thanks for the help
> matt
Re: Casting ISelection-Content to PackageEditPart resolves in VM-Crash [message #623700 is a reply to message #476380] Tue, 28 April 2009 10:40 Go to previous message
Tatiana Fesenko is currently offline Tatiana Fesenko
Messages: 530
Registered: July 2009
Senior Member
Hello Matt,

Does the problem repeat after restarting Eclipse? If it still does, what
arguments do you pass to your virtual machine?

Best wishes,
Tanya.

> hello.
>
> i am currently trying to connect generated model refactorings from the
> emft project to the graphical editor of the uml2tools. it seemed
> simple since i only have to take the selected EditPart, "extract" the
> model element which is needed by the refactoring and start the
> refactoring with the extracted model element.
>
> BUT: somehow whenever i take the EditPart (in this case the
> PackageEditPart) out of the given ISelection and try to cast the
> Object to its actual Class (code snippet to follow) i end up with the
> VM stopping with an unexpected error. What i am trying to to is the
> following:
>
> @Override
> public void run(IAction action) {
> StructuredSelection s = (StructuredSelection) selection;
> PackageEditPart pEP = null;
> Object o = s.getFirstElement();
> if(o instanceof PackageEditPart) //VM reports unexpected error here
> pEP = (PackageEditPart)o; //or here if I delete the line above
> org.eclipse.uml2.uml.Package p =
> (org.eclipse.uml2.uml.Package)pEP.resolveSemanticElement();
> org.eclipse.uml2.uml.Package selectedEObject = p;
>
> RefactoringWizard wizard = new RefactoringWizard(selectedEObject);
>
> the debugger shows, that the selection contains only one object which
> is a PackageEditPart, however, instanceof checks and casts dont work
> an instead the VM crashes with the following statement:
>
> An unexpected error has been detected by Java Runtime Environment:
> #
> # Internal Error (constantPoolOop.cpp:67), pid=948, tid=2512
> # Error: guarantee(error != (symbolOop)0,"tag mismatch with
> resolution
> error table")
> #
> # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode
> windows-x86)
> # An error report file with more information is saved as:
> # C:\Users\tdc\AppData\Local\Temp\hs_err_pid948.log
> thanks for the help
> matt
Previous Topic:Casting ISelection-Content to PackageEditPart resolves in VM-Crash
Next Topic:Add new shapes via plugin / extension point
Goto Forum:
  


Current Time: Fri Oct 24 07:55:51 GMT 2014

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

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