PrimitiveType problem [message #523225] |
Thu, 25 March 2010 06:22  |
Eclipse User |
|
|
|
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 13:55  |
Eclipse User |
|
|
|
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
>
|
|
|
Powered by
FUDForum. Page generated in 0.03253 seconds