Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EAttribute.getDefaultValue returns Integer(0) when upperbound=-1 and eDataType is integer
EAttribute.getDefaultValue returns Integer(0) when upperbound=-1 and eDataType is integer [message #431238] Sat, 04 July 2009 22:17 Go to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi,
I am debugging for CDO-Teneo and found that when calling EAttribute.getDefaultValue() for an EAttribute with upperbound
-1 and EDataType int that a value of Integer 0 is returned. I am wondering is this correct/intended behavior?
I myself would expect a null value.

--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: EAttribute.getDefaultValue returns Integer(0) when upperbound=-1 and eDataType is integer [message #431239 is a reply to message #431238] Sun, 05 July 2009 01:01 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040409070700000006050905
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Martin,

I suppose this code should be checking that feature is single valued:

public Object getDefaultValue()
{
EClassifier eType = getEType();
String literal = getDefaultValueLiteral();

if (literal == null && eType != null)
{
return eType.getDefaultValue();
}



Martin Taal wrote:
> Hi,
> I am debugging for CDO-Teneo and found that when calling
> EAttribute.getDefaultValue() for an EAttribute with upperbound -1 and
> EDataType int that a value of Integer 0 is returned. I am wondering is
> this correct/intended behavior?
> I myself would expect a null value.
>

--------------040409070700000006050905
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Martin,<br>
<br>
I suppose this code should be checking that feature is single valued:<small><br>
</small>
<blockquote><small>&nbsp; public Object getDefaultValue()</small><br>
<small>&nbsp; {</small><br>
<small>&nbsp;&nbsp;&nbsp; EClassifier eType = getEType();</small><br>
<small>&nbsp;&nbsp;&nbsp; String literal = getDefaultValueLiteral();</small><br>
<br>
<small>&nbsp;&nbsp;&nbsp; if (literal == null &amp;&amp; eType != null)</small><br>
<small>&nbsp;&nbsp;&nbsp; {</small><br>
<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return eType.getDefaultValue();</small><br>
<small>&nbsp;&nbsp;&nbsp; }</small><br>
</blockquote>
<br>
<br>
Martin Taal wrote:
<blockquote cite="mid:h2okd1$adc$1@build.eclipse.org" type="cite">Hi,
<br>
I am debugging for CDO-Teneo and found that when calling
EAttribute.getDefaultValue() for an EAttribute with upperbound -1 and
EDataType int that a value of Integer 0 is returned. I am wondering is
this correct/intended behavior?
<br>
I myself would expect a null value.
<br>
<br>
</blockquote>
</body>
</html>

--------------040409070700000006050905--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EAttribute.getDefaultValue returns Integer(0) when upperbound=-1 and eDataType is integer [message #431242 is a reply to message #431239] Sun, 05 July 2009 09:26 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Ed,
I understand that I should file a bugzilla, here you go:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=282452

gr. Martin

Ed Merks wrote:
> Martin,
>
> I suppose this code should be checking that feature is single valued:
>
> public Object getDefaultValue()
> {
> EClassifier eType = getEType();
> String literal = getDefaultValueLiteral();
>
> if (literal == null && eType != null)
> {
> return eType.getDefaultValue();
> }
>
>
>
> Martin Taal wrote:
>> Hi,
>> I am debugging for CDO-Teneo and found that when calling
>> EAttribute.getDefaultValue() for an EAttribute with upperbound -1 and
>> EDataType int that a value of Integer 0 is returned. I am wondering is
>> this correct/intended behavior?
>> I myself would expect a null value.
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Previous Topic:java.lang.AbstractMethodError in registerEntityNameResolvers
Next Topic:[CDO] A lock that is not automatically released by a commit
Goto Forum:
  


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

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

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

Back to the top