Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] Resource.getEObject() method throws exception instead of null
[Teneo] Resource.getEObject() method throws exception instead of null [message #93930] Wed, 22 August 2007 09:33 Go to next message
Dimitar Stamenov is currently offline Dimitar StamenovFriend
Messages: 18
Registered: July 2009
Junior Member
Hi Martin,

When I use the standard EMF model, Resource.getEObject(String objectID)
method returns null if there is no object with the specified objectID.
So the code that I have written relies on that premise.

However Teneo does not return null but throws
StringIndexOutOfBoundsException in the method
JPOXResource.getEObjectByID(). Do you think that it is more reasonable
to change Teneo to return null instead of this exception?

I am sending you the stack trace of the exception.

Regards
Dimitar

Stack trace:
java.lang.StringIndexOutOfBoundsException
at java.lang.String.substring(String.java:1088)
at org.jpox.store.OID.<init>(OID.java:105)
at
org.eclipse.emf.teneo.jpox.resource.JPOXResource.getEObjectB yID(JPOXResource.java:302)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject( ResourceImpl.java:683)
Re: [Teneo] Resource.getEObject() method throws exception instead of null [message #93946 is a reply to message #93930] Wed, 22 August 2007 11:28 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Dimitar,
Yes that would be more logical. Can you enter a bugzilla for this?

gr. Martin

Dimitar Stamenov wrote:
> Hi Martin,
>
> When I use the standard EMF model, Resource.getEObject(String objectID)
> method returns null if there is no object with the specified objectID.
> So the code that I have written relies on that premise.
>
> However Teneo does not return null but throws
> StringIndexOutOfBoundsException in the method
> JPOXResource.getEObjectByID(). Do you think that it is more reasonable
> to change Teneo to return null instead of this exception?
>
> I am sending you the stack trace of the exception.
>
> Regards
> Dimitar
>
> Stack trace:
> java.lang.StringIndexOutOfBoundsException
> at java.lang.String.substring(String.java:1088)
> at org.jpox.store.OID.<init>(OID.java:105)
> at
> org.eclipse.emf.teneo.jpox.resource.JPOXResource.getEObjectB yID(JPOXResource.java:302)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject( ResourceImpl.java:683)
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
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: [Teneo] Resource.getEObject() method throws exception instead of null [message #93961 is a reply to message #93946] Wed, 22 August 2007 14:00 Go to previous message
Dimitar Stamenov is currently offline Dimitar StamenovFriend
Messages: 18
Registered: July 2009
Junior Member
Hi Martin, I have created the bugzilla.

Martin Taal wrote:
> Hi Dimitar,
> Yes that would be more logical. Can you enter a bugzilla for this?
>
> gr. Martin
>
> Dimitar Stamenov wrote:
>> Hi Martin,
>>
>> When I use the standard EMF model, Resource.getEObject(String
>> objectID) method returns null if there is no object with the specified
>> objectID. So the code that I have written relies on that premise.
>>
>> However Teneo does not return null but throws
>> StringIndexOutOfBoundsException in the method
>> JPOXResource.getEObjectByID(). Do you think that it is more reasonable
>> to change Teneo to return null instead of this exception?
>>
>> I am sending you the stack trace of the exception.
>>
>> Regards
>> Dimitar
>>
>> Stack trace:
>> java.lang.StringIndexOutOfBoundsException
>> at java.lang.String.substring(String.java:1088)
>> at org.jpox.store.OID.<init>(OID.java:105)
>> at
>> org.eclipse.emf.teneo.jpox.resource.JPOXResource.getEObjectB yID(JPOXResource.java:302)
>>
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject( ResourceImpl.java:683)
>>
>
>
Re: [Teneo] Resource.getEObject() method throws exception instead of null [message #609506 is a reply to message #93930] Wed, 22 August 2007 11:28 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Dimitar,
Yes that would be more logical. Can you enter a bugzilla for this?

gr. Martin

Dimitar Stamenov wrote:
> Hi Martin,
>
> When I use the standard EMF model, Resource.getEObject(String objectID)
> method returns null if there is no object with the specified objectID.
> So the code that I have written relies on that premise.
>
> However Teneo does not return null but throws
> StringIndexOutOfBoundsException in the method
> JPOXResource.getEObjectByID(). Do you think that it is more reasonable
> to change Teneo to return null instead of this exception?
>
> I am sending you the stack trace of the exception.
>
> Regards
> Dimitar
>
> Stack trace:
> java.lang.StringIndexOutOfBoundsException
> at java.lang.String.substring(String.java:1088)
> at org.jpox.store.OID.<init>(OID.java:105)
> at
> org.eclipse.emf.teneo.jpox.resource.JPOXResource.getEObjectB yID(JPOXResource.java:302)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject( ResourceImpl.java:683)
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
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: [Teneo] Resource.getEObject() method throws exception instead of null [message #609507 is a reply to message #93946] Wed, 22 August 2007 14:00 Go to previous message
Dimitar Stamenov is currently offline Dimitar StamenovFriend
Messages: 18
Registered: July 2009
Junior Member
Hi Martin, I have created the bugzilla.

Martin Taal wrote:
> Hi Dimitar,
> Yes that would be more logical. Can you enter a bugzilla for this?
>
> gr. Martin
>
> Dimitar Stamenov wrote:
>> Hi Martin,
>>
>> When I use the standard EMF model, Resource.getEObject(String
>> objectID) method returns null if there is no object with the specified
>> objectID. So the code that I have written relies on that premise.
>>
>> However Teneo does not return null but throws
>> StringIndexOutOfBoundsException in the method
>> JPOXResource.getEObjectByID(). Do you think that it is more reasonable
>> to change Teneo to return null instead of this exception?
>>
>> I am sending you the stack trace of the exception.
>>
>> Regards
>> Dimitar
>>
>> Stack trace:
>> java.lang.StringIndexOutOfBoundsException
>> at java.lang.String.substring(String.java:1088)
>> at org.jpox.store.OID.<init>(OID.java:105)
>> at
>> org.eclipse.emf.teneo.jpox.resource.JPOXResource.getEObjectB yID(JPOXResource.java:302)
>>
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject( ResourceImpl.java:683)
>>
>
>
Previous Topic:[Teneo] Resource.getEObject() method throws exception instead of null
Next Topic:[Teneo] Illegal Argument Exception saving null object enumeration
Goto Forum:
  


Current Time: Sat Aug 13 01:13:54 GMT 2022

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

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

Back to the top