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 #623698] Mon, 27 April 2009 09:55
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
Previous Topic:How to change appearance of diagram programatically?
Next Topic:Casting ISelection-Content to PackageEditPart resolves in VM-Crash
Goto Forum:
  


Current Time: Mon Jul 28 12:26:52 EDT 2014

Powered by FUDForum. Page generated in 0.02849 seconds