Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » PrimitiveType problem
PrimitiveType problem [message #523225] Thu, 25 March 2010 10:22 Go to next message
Martynas  L is currently offline Martynas LFriend
Messages: 16
Registered: July 2009
Junior Member
Hello,

I create primitive type, and define the profile. The corresponding
EDataType's instanceName is:

v2.0.4: instanceName="java.lang.Class"
v3.0.1: instanceName="<primitive type name>"

In both versions there is the same code in
org.eclipse.uml2.uml.util.UMLUtil#convertToEcore(Profile, Map,
DiagnosticChain, Map) to set the instanceName to String:

public Object caseEDataType(EDataType eDataType) {

try {
eDataType.getInstanceClass();
} catch (Exception e) {
eDataType
.setInstanceClassName(EcorePackage.Literals.ESTRING
.getInstanceClassName());
}

return eDataType;
}


The problem is that
org.eclipse.emf.ecore.impl.EClassifierImpl#getInstanceClass( ) does throw
exception in EMF v2.2.3 (UML2 v2.0.4):

try
{
setInstanceClassGen(getClassForName(getInstanceClassName())) ;
}
catch (ClassNotFoundException e)
{
Class primitiveClass = getPrimitiveOrArrayClass();
if (primitiveClass != null)
setInstanceClassGen(primitiveClass);
else
throw new WrappedException(e);
}

But does not throw exception in EMF v2.5.0 (UML2 v3.0.1):

try
{
setInstanceClassGen(getClassForName(getInstanceClassName())) ;
}
catch (ClassNotFoundException e)
{
// Ignore exceptions.
}

That's why the instanceName is not set to String and it is not possible to
use the created primitive type as stereotype property type - a string value
can not be set as element value.

Best regards,
Martynas
Re: PrimitiveType problem [message #523537 is a reply to message #523225] Fri, 26 March 2010 17:55 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Martynas,

Please raise a bugzilla on this.
Thanks
- James.

"Martynas Lelevicius" <marte@nomagic.com> wrote in message
news:hofue9$8te$1@build.eclipse.org...
> Hello,
>
> I create primitive type, and define the profile. The corresponding
> EDataType's instanceName is:
>
> v2.0.4: instanceName="java.lang.Class"
> v3.0.1: instanceName="<primitive type name>"
>
> In both versions there is the same code in
> org.eclipse.uml2.uml.util.UMLUtil#convertToEcore(Profile, Map,
> DiagnosticChain, Map) to set the instanceName to String:
>
> public Object caseEDataType(EDataType eDataType) {
>
> try {
> eDataType.getInstanceClass();
> } catch (Exception e) {
> eDataType
> .setInstanceClassName(EcorePackage.Literals.ESTRING
> .getInstanceClassName());
> }
>
> return eDataType;
> }
>
>
> The problem is that
> org.eclipse.emf.ecore.impl.EClassifierImpl#getInstanceClass( ) does throw
> exception in EMF v2.2.3 (UML2 v2.0.4):
>
> try
> {
> setInstanceClassGen(getClassForName(getInstanceClassName())) ;
> }
> catch (ClassNotFoundException e)
> {
> Class primitiveClass = getPrimitiveOrArrayClass();
> if (primitiveClass != null)
> setInstanceClassGen(primitiveClass);
> else
> throw new WrappedException(e);
> }
>
> But does not throw exception in EMF v2.5.0 (UML2 v3.0.1):
>
> try
> {
> setInstanceClassGen(getClassForName(getInstanceClassName())) ;
> }
> catch (ClassNotFoundException e)
> {
> // Ignore exceptions.
> }
>
> That's why the instanceName is not set to String and it is not possible to
> use the created primitive type as stereotype property type - a string
> value can not be set as element value.
>
> Best regards,
> Martynas
>
Previous Topic:Problems with generated createSubsetsAnnotations
Next Topic:PrimitiveType problem
Goto Forum:
  


Current Time: Thu Apr 25 01:46:49 GMT 2024

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

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

Back to the top