Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Compare] in-memory model and ArrayIndexOutOfBoundsException
[Compare] in-memory model and ArrayIndexOutOfBoundsException [message #525434] Tue, 06 April 2010 15:00 Go to next message
Eclipse UserFriend
Originally posted by: formatzeh.gmx.de

Hello NG,
I write a little plugin which should load a model from a file, copys it
into a second in-memory model, do some modifications on the copy and
present a comparison to the user. I want to embed the composite of the
standard compare editor into another composite because I want to present
it to the other within an existent dialog. So I subclassed
CompareEditorInput and called createContents(parent) in its constructor
to just create the compare composite as a child of parent. Until now, I
couldn't test it properly because I get the mentioned
ArrayIndexOutOfBoundsException in the method prepareInput where the diff
model is created as follows:

Map<String, Object> options = new LinkedHashMap<String, Object>();
options.put(MatchOptions.OPTION_DISTINCT_METAMODELS, true);
options.put(MatchOptions.OPTION_IGNORE_ID, true);
options.put(MatchOptions.OPTION_IGNORE_XMI_ID, true);
options.put(MatchOptions.OPTION_PROGRESS_MONITOR, monitor);
MatchModel match = MatchService.doContentMatch(originalModel,
copiedModel, options);
DiffModel diff = DiffService.doDiff(match, false);

While debugging I found out that in doDiff the class ResourceSimilarity
will be used and in the method computeURISimilarity(URI reference, URI
candidate) the segments of the URIs will be compared. My problem at this
point is that the copied model is only in-memory and has no resource. So
the URIs of two elements which differ in their name attribute are:

original: platform:/resource/Test/pl0/p1.pl0#//@block/@constants.1
copied: #///@block/@constants.1

In this method the segments of those URIs will be extracted, resulting in:

original: [resource, Test, pl0, p1]
copied: []

As you can see here, the segments of the copied elements is empty
because it doesn't belong to any resource. Then the method
resourceURISimilarity(String[] reference, String[] candidate) is invoked
and, as you can imagine, here the ArrayIndexOutOfBoundsException is
thrown because of the following line:

final String candidateName = candidate[candidate.length - 1];

This results in the try to get the element -1 of the copied segments.
Now the question: what can I do to solve this problem?

best regards,
Gilbert
Re: [Compare] in-memory model and ArrayIndexOutOfBoundsException [message #525459 is a reply to message #525434] Tue, 06 April 2010 11:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: formatzeh.gmx.de

I thought I could checkout the latest version from the cvs repository. I
browsed a little bit over the checkd out code and surprise - the method
resourceURISimilarity(String[] reference, String[] candidate) now does
the following check:

double similarity = 0d;
if (reference.length != 0 && candidate.length != 0) {
//...
} else { //... }
return similarity;

Now, I thought, my code can be run. But now there is another exception.
Namely, when I invoked MatchService.doContentMatch(..) for creating the
match model for in-memory models and not for resources, thi first code
line in this method is the following:

IMatchEngine engine = getBestMatchEngine(leftObject.eResource(),
rightObject.eResource());

getBestMatchEngine then creates a new ModelIdentifier and unfortunately
this identifier tries to instantiate URIs from my resources. As you can
see now, one of my resources is null because the copied model doesn't
have any. What can I do that it finally works?
Re: [Compare] in-memory model and ArrayIndexOutOfBoundsException [message #525608 is a reply to message #525459] Wed, 07 April 2010 07:45 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090403030907030503090407
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Hi Gilbert,

Your first issue has been fixed through a contribution from Stephan
Eberle with https://bugs.eclipse.org/bugs/show_bug.cgi?id=296905 . This
first patch was sufficient for them to compare resources which URI have
no segments and they haven't encountered your second issue.

I could easily rule out your NPE by adding a null test ... I'm positive
this would only unveil another hidden exception. Could you take some
time to patch EMF Compare on the lines where you encounter failures and
raise a bug with it? Only null tests or such will be sufficient, I'll
retrieve the patch and add the missing logic if any ... though I doubt
this calls for difficult coding :p.

Whether you have time to patch the issues or not, please raise a bug on
the Eclipse bugzilla so that we can track down the problem.

As a side note, if you need a quick workaround for this, you can set a
dummy URI to your copied resource to avoid all problems.

Laurent Goubet
Obeo

Gilbert Mirenque wrote:
> I thought I could checkout the latest version from the cvs repository. I
> browsed a little bit over the checkd out code and surprise - the method
> resourceURISimilarity(String[] reference, String[] candidate) now does
> the following check:
>
> double similarity = 0d;
> if (reference.length != 0 && candidate.length != 0) {
> //...
> } else { //... }
> return similarity;
>
> Now, I thought, my code can be run. But now there is another exception.
> Namely, when I invoked MatchService.doContentMatch(..) for creating the
> match model for in-memory models and not for resources, thi first code
> line in this method is the following:
>
> IMatchEngine engine = getBestMatchEngine(leftObject.eResource(),
> rightObject.eResource());
>
> getBestMatchEngine then creates a new ModelIdentifier and unfortunately
> this identifier tries to instantiate URIs from my resources. As you can
> see now, one of my resources is null because the copied model doesn't
> have any. What can I do that it finally works?


--------------090403030907030503090407
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr">Obeo</a>
email;internet:laurent.goubet@obeo.fr
url:http://www.obeo.fr
version:2.1
end:vcard


--------------090403030907030503090407--
Re: [Compare] in-memory model and ArrayIndexOutOfBoundsException [message #525631 is a reply to message #525608] Wed, 07 April 2010 09:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: formatzeh.gmx.de

Hi Laurent,

> Whether you have time to patch the issues or not, please raise a bug on
> the Eclipse bugzilla so that we can track down the problem.

I filed a bug report and submitted a patch at
https://bugs.eclipse.org/bugs/show_bug.cgi?id=308306
Re: [Compare] in-memory model and ArrayIndexOutOfBoundsException [message #525633 is a reply to message #525631] Wed, 07 April 2010 09:35 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------050509080200080705010802
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Thanks for this, I'll take a further look asap.

Gilbert Mirenque wrote:
> Hi Laurent,
>
>> Whether you have time to patch the issues or not, please raise a bug on
>> the Eclipse bugzilla so that we can track down the problem.
>
> I filed a bug report and submitted a patch at
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=308306


--------------050509080200080705010802
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr">Obeo</a>
email;internet:laurent.goubet@obeo.fr
url:http://www.obeo.fr
version:2.1
end:vcard


--------------050509080200080705010802--
Re: [Compare] in-memory model and ArrayIndexOutOfBoundsException [message #525744 is a reply to message #525633] Wed, 07 April 2010 16:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: formatzeh.gmx.de

Laurent,
I pointed out another aspect which is connected with this whole
in-memory model comparison stuff. I saw that you committed the patch but
when I now try to compare the models the right side in the dialog is
always empty. While debugging I saw that in the GenericMatchEngine the
following method can be found:

protected void setModelRoots(MatchModel modelRoot, EObject left, EObject
right, EObject ancestor) {
// Sets values of left, right and ancestor model roots
if (left != null && left.eResource() != null) {
modelRoot.getLeftRoots().addAll(left.eResource().getContents ());
}
if (right != null && right.eResource() != null) {
modelRoot.getRightRoots().addAll(right.eResource().getConten ts());
}
if (ancestor != null && ancestor.eResource() != null) {
modelRoot.getAncestorRoots().addAll(ancestor.eResource().get Contents());
}
}

You see that if any of the models has no resource than the roots won't
be set resulting in the empty pane in the dialog. I know that I can
extend the GenericMatchEngine but I think of consistency reasons this
should be adapted?
Re: [Compare] in-memory model and ArrayIndexOutOfBoundsException [message #525751 is a reply to message #525744] Wed, 07 April 2010 16:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: formatzeh.gmx.de

> You see that if any of the models has no resource than the roots won't
> be set resulting in the empty pane in the dialog. I know that I can
> extend the GenericMatchEngine but I think of consistency reasons this
> should be adapted?

Damn...I now used a subclass of the GenericMatchEngine but without any
success. The roots will be set now, but the right pane, containing the
in-memory model, stays empty. The strange thing is that the differences
will be marked right with thos red or green lines on the left pane. And
if I select an element, which has only a different attribute value, and
then open the properties tab, then on both sides the correct attribute
is shown. On the left the original value and on the right the in-memory
model value. But the right pane with the differences stays empty :(
Re: [Compare] in-memory model and ArrayIndexOutOfBoundsException [message #525894 is a reply to message #525751] Thu, 08 April 2010 08:16 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010204000007020708050706
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Gilbert,

The model roots references are only there to help people using
serialized differences in finding back the models that were compared ;
it isn't used in any other way by the EMF Compare core or UI.

I believe your issue comes from the content provider we use to find the
elements that are to be displayed. Namely, I believe we only take
ResourceSets as input and thus your in-memory model isn't handled. I'll
take a look asap, but if you need to go faster, taker a look at the code
of ModelContentMergeDiffTabContentProvider#getElements(Object) which I
believe is the culprit.

Laurent Goubet
Obeo

Gilbert Mirenque wrote:
>> You see that if any of the models has no resource than the roots won't
>> be set resulting in the empty pane in the dialog. I know that I can
>> extend the GenericMatchEngine but I think of consistency reasons this
>> should be adapted?
>
> Damn...I now used a subclass of the GenericMatchEngine but without any
> success. The roots will be set now, but the right pane, containing the
> in-memory model, stays empty. The strange thing is that the differences
> will be marked right with thos red or green lines on the left pane. And
> if I select an element, which has only a different attribute value, and
> then open the properties tab, then on both sides the correct attribute
> is shown. On the left the original value and on the right the in-memory
> model value. But the right pane with the differences stays empty :(


--------------010204000007020708050706
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr">Obeo</a>
email;internet:laurent.goubet@obeo.fr
url:http://www.obeo.fr
version:2.1
end:vcard


--------------010204000007020708050706--
Re: [Compare] in-memory model and ArrayIndexOutOfBoundsException [message #525902 is a reply to message #525894] Thu, 08 April 2010 08:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: formatzeh.gmx.de

Hi Laurent,
yes, you are right. There are some other places which is is in coherence
with this. I submitted a patch under
https://bugs.eclipse.org/bugs/show_bug.cgi?id=308446

best regards,
Gilbert

> The model roots references are only there to help people using
> serialized differences in finding back the models that were compared ;
> it isn't used in any other way by the EMF Compare core or UI.
>
> I believe your issue comes from the content provider we use to find the
> elements that are to be displayed. Namely, I believe we only take
> ResourceSets as input and thus your in-memory model isn't handled. I'll
> take a look asap, but if you need to go faster, taker a look at the code
> of ModelContentMergeDiffTabContentProvider#getElements(Object) which I
> believe is the culprit.
>
> Laurent Goubet
> Obeo
>
> Gilbert Mirenque wrote:
>>> You see that if any of the models has no resource than the roots won't
>>> be set resulting in the empty pane in the dialog. I know that I can
>>> extend the GenericMatchEngine but I think of consistency reasons this
>>> should be adapted?
>>
>> Damn...I now used a subclass of the GenericMatchEngine but without any
>> success. The roots will be set now, but the right pane, containing the
>> in-memory model, stays empty. The strange thing is that the differences
>> will be marked right with thos red or green lines on the left pane. And
>> if I select an element, which has only a different attribute value, and
>> then open the properties tab, then on both sides the correct attribute
>> is shown. On the left the original value and on the right the in-memory
>> model value. But the right pane with the differences stays empty :(
>
Re: [Compare] in-memory model and ArrayIndexOutOfBoundsException [message #525914 is a reply to message #525902] Thu, 08 April 2010 09:07 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040100030101060307030502
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Not even enough time to take a look myself :D. I'll need some time to
validate that this patch doesn't break other uses cases, I'll commit it
on CVS once done.

Laurent Goubet
Obeo

Gilbert Mirenque wrote:
> Hi Laurent,
> yes, you are right. There are some other places which is is in coherence
> with this. I submitted a patch under
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=308446
>
> best regards,
> Gilbert
>
>> The model roots references are only there to help people using
>> serialized differences in finding back the models that were compared ;
>> it isn't used in any other way by the EMF Compare core or UI.
>>
>> I believe your issue comes from the content provider we use to find the
>> elements that are to be displayed. Namely, I believe we only take
>> ResourceSets as input and thus your in-memory model isn't handled. I'll
>> take a look asap, but if you need to go faster, taker a look at the code
>> of ModelContentMergeDiffTabContentProvider#getElements(Object) which I
>> believe is the culprit.
>>
>> Laurent Goubet
>> Obeo
>>
>> Gilbert Mirenque wrote:
>>>> You see that if any of the models has no resource than the roots won't
>>>> be set resulting in the empty pane in the dialog. I know that I can
>>>> extend the GenericMatchEngine but I think of consistency reasons this
>>>> should be adapted?
>>> Damn...I now used a subclass of the GenericMatchEngine but without any
>>> success. The roots will be set now, but the right pane, containing the
>>> in-memory model, stays empty. The strange thing is that the differences
>>> will be marked right with thos red or green lines on the left pane. And
>>> if I select an element, which has only a different attribute value, and
>>> then open the properties tab, then on both sides the correct attribute
>>> is shown. On the left the original value and on the right the in-memory
>>> model value. But the right pane with the differences stays empty :(
>


--------------040100030101060307030502
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr">Obeo</a>
email;internet:laurent.goubet@obeo.fr
url:http://www.obeo.fr
version:2.1
end:vcard


--------------040100030101060307030502--
Re: [Compare] in-memory model and ArrayIndexOutOfBoundsException [message #622419 is a reply to message #525434] Tue, 06 April 2010 15:49 Go to previous message
Eclipse UserFriend
Originally posted by: formatzeh.gmx.de

I thought I could checkout the latest version from the cvs repository. I
browsed a little bit over the checkd out code and surprise - the method
resourceURISimilarity(String[] reference, String[] candidate) now does
the following check:

double similarity = 0d;
if (reference.length != 0 && candidate.length != 0) {
//...
} else { //... }
return similarity;

Now, I thought, my code can be run. But now there is another exception.
Namely, when I invoked MatchService.doContentMatch(..) for creating the
match model for in-memory models and not for resources, thi first code
line in this method is the following:

IMatchEngine engine = getBestMatchEngine(leftObject.eResource(),
rightObject.eResource());

getBestMatchEngine then creates a new ModelIdentifier and unfortunately
this identifier tries to instantiate URIs from my resources. As you can
see now, one of my resources is null because the copied model doesn't
have any. What can I do that it finally works?
Re: [Compare] in-memory model and ArrayIndexOutOfBoundsException [message #622421 is a reply to message #622419] Wed, 07 April 2010 07:45 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090403030907030503090407
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Hi Gilbert,

Your first issue has been fixed through a contribution from Stephan
Eberle with https://bugs.eclipse.org/bugs/show_bug.cgi?id=296905 . This
first patch was sufficient for them to compare resources which URI have
no segments and they haven't encountered your second issue.

I could easily rule out your NPE by adding a null test ... I'm positive
this would only unveil another hidden exception. Could you take some
time to patch EMF Compare on the lines where you encounter failures and
raise a bug with it? Only null tests or such will be sufficient, I'll
retrieve the patch and add the missing logic if any ... though I doubt
this calls for difficult coding :p.

Whether you have time to patch the issues or not, please raise a bug on
the Eclipse bugzilla so that we can track down the problem.

As a side note, if you need a quick workaround for this, you can set a
dummy URI to your copied resource to avoid all problems.

Laurent Goubet
Obeo

Gilbert Mirenque wrote:
> I thought I could checkout the latest version from the cvs repository. I
> browsed a little bit over the checkd out code and surprise - the method
> resourceURISimilarity(String[] reference, String[] candidate) now does
> the following check:
>
> double similarity = 0d;
> if (reference.length != 0 && candidate.length != 0) {
> //...
> } else { //... }
> return similarity;
>
> Now, I thought, my code can be run. But now there is another exception.
> Namely, when I invoked MatchService.doContentMatch(..) for creating the
> match model for in-memory models and not for resources, thi first code
> line in this method is the following:
>
> IMatchEngine engine = getBestMatchEngine(leftObject.eResource(),
> rightObject.eResource());
>
> getBestMatchEngine then creates a new ModelIdentifier and unfortunately
> this identifier tries to instantiate URIs from my resources. As you can
> see now, one of my resources is null because the copied model doesn't
> have any. What can I do that it finally works?


--------------090403030907030503090407
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr">Obeo</a>
email;internet:laurent.goubet@obeo.fr
url:http://www.obeo.fr
version:2.1
end:vcard


--------------090403030907030503090407--
Re: [Compare] in-memory model and ArrayIndexOutOfBoundsException [message #622422 is a reply to message #525608] Wed, 07 April 2010 09:30 Go to previous message
Eclipse UserFriend
Originally posted by: formatzeh.gmx.de

Hi Laurent,

> Whether you have time to patch the issues or not, please raise a bug on
> the Eclipse bugzilla so that we can track down the problem.

I filed a bug report and submitted a patch at
https://bugs.eclipse.org/bugs/show_bug.cgi?id=308306
Re: [Compare] in-memory model and ArrayIndexOutOfBoundsException [message #622423 is a reply to message #525631] Wed, 07 April 2010 09:35 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------050509080200080705010802
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Thanks for this, I'll take a further look asap.

Gilbert Mirenque wrote:
> Hi Laurent,
>
>> Whether you have time to patch the issues or not, please raise a bug on
>> the Eclipse bugzilla so that we can track down the problem.
>
> I filed a bug report and submitted a patch at
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=308306


--------------050509080200080705010802
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr">Obeo</a>
email;internet:laurent.goubet@obeo.fr
url:http://www.obeo.fr
version:2.1
end:vcard


--------------050509080200080705010802--
Re: [Compare] in-memory model and ArrayIndexOutOfBoundsException [message #622424 is a reply to message #525633] Wed, 07 April 2010 16:04 Go to previous message
Eclipse UserFriend
Originally posted by: formatzeh.gmx.de

Laurent,
I pointed out another aspect which is connected with this whole
in-memory model comparison stuff. I saw that you committed the patch but
when I now try to compare the models the right side in the dialog is
always empty. While debugging I saw that in the GenericMatchEngine the
following method can be found:

protected void setModelRoots(MatchModel modelRoot, EObject left, EObject
right, EObject ancestor) {
// Sets values of left, right and ancestor model roots
if (left != null && left.eResource() != null) {
modelRoot.getLeftRoots().addAll(left.eResource().getContents ());
}
if (right != null && right.eResource() != null) {
modelRoot.getRightRoots().addAll(right.eResource().getConten ts());
}
if (ancestor != null && ancestor.eResource() != null) {
modelRoot.getAncestorRoots().addAll(ancestor.eResource().get Contents());
}
}

You see that if any of the models has no resource than the roots won't
be set resulting in the empty pane in the dialog. I know that I can
extend the GenericMatchEngine but I think of consistency reasons this
should be adapted?
Re: [Compare] in-memory model and ArrayIndexOutOfBoundsException [message #622425 is a reply to message #525744] Wed, 07 April 2010 16:35 Go to previous message
Eclipse UserFriend
Originally posted by: formatzeh.gmx.de

> You see that if any of the models has no resource than the roots won't
> be set resulting in the empty pane in the dialog. I know that I can
> extend the GenericMatchEngine but I think of consistency reasons this
> should be adapted?

Damn...I now used a subclass of the GenericMatchEngine but without any
success. The roots will be set now, but the right pane, containing the
in-memory model, stays empty. The strange thing is that the differences
will be marked right with thos red or green lines on the left pane. And
if I select an element, which has only a different attribute value, and
then open the properties tab, then on both sides the correct attribute
is shown. On the left the original value and on the right the in-memory
model value. But the right pane with the differences stays empty :(
Re: [Compare] in-memory model and ArrayIndexOutOfBoundsException [message #622426 is a reply to message #525751] Thu, 08 April 2010 08:16 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010204000007020708050706
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Gilbert,

The model roots references are only there to help people using
serialized differences in finding back the models that were compared ;
it isn't used in any other way by the EMF Compare core or UI.

I believe your issue comes from the content provider we use to find the
elements that are to be displayed. Namely, I believe we only take
ResourceSets as input and thus your in-memory model isn't handled. I'll
take a look asap, but if you need to go faster, taker a look at the code
of ModelContentMergeDiffTabContentProvider#getElements(Object) which I
believe is the culprit.

Laurent Goubet
Obeo

Gilbert Mirenque wrote:
>> You see that if any of the models has no resource than the roots won't
>> be set resulting in the empty pane in the dialog. I know that I can
>> extend the GenericMatchEngine but I think of consistency reasons this
>> should be adapted?
>
> Damn...I now used a subclass of the GenericMatchEngine but without any
> success. The roots will be set now, but the right pane, containing the
> in-memory model, stays empty. The strange thing is that the differences
> will be marked right with thos red or green lines on the left pane. And
> if I select an element, which has only a different attribute value, and
> then open the properties tab, then on both sides the correct attribute
> is shown. On the left the original value and on the right the in-memory
> model value. But the right pane with the differences stays empty :(


--------------010204000007020708050706
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr">Obeo</a>
email;internet:laurent.goubet@obeo.fr
url:http://www.obeo.fr
version:2.1
end:vcard


--------------010204000007020708050706--
Re: [Compare] in-memory model and ArrayIndexOutOfBoundsException [message #622427 is a reply to message #525894] Thu, 08 April 2010 08:32 Go to previous message
Eclipse UserFriend
Originally posted by: formatzeh.gmx.de

Hi Laurent,
yes, you are right. There are some other places which is is in coherence
with this. I submitted a patch under
https://bugs.eclipse.org/bugs/show_bug.cgi?id=308446

best regards,
Gilbert

> The model roots references are only there to help people using
> serialized differences in finding back the models that were compared ;
> it isn't used in any other way by the EMF Compare core or UI.
>
> I believe your issue comes from the content provider we use to find the
> elements that are to be displayed. Namely, I believe we only take
> ResourceSets as input and thus your in-memory model isn't handled. I'll
> take a look asap, but if you need to go faster, taker a look at the code
> of ModelContentMergeDiffTabContentProvider#getElements(Object) which I
> believe is the culprit.
>
> Laurent Goubet
> Obeo
>
> Gilbert Mirenque wrote:
>>> You see that if any of the models has no resource than the roots won't
>>> be set resulting in the empty pane in the dialog. I know that I can
>>> extend the GenericMatchEngine but I think of consistency reasons this
>>> should be adapted?
>>
>> Damn...I now used a subclass of the GenericMatchEngine but without any
>> success. The roots will be set now, but the right pane, containing the
>> in-memory model, stays empty. The strange thing is that the differences
>> will be marked right with thos red or green lines on the left pane. And
>> if I select an element, which has only a different attribute value, and
>> then open the properties tab, then on both sides the correct attribute
>> is shown. On the left the original value and on the right the in-memory
>> model value. But the right pane with the differences stays empty :(
>
Re: [Compare] in-memory model and ArrayIndexOutOfBoundsException [message #622428 is a reply to message #525902] Thu, 08 April 2010 09:07 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040100030101060307030502
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Not even enough time to take a look myself :D. I'll need some time to
validate that this patch doesn't break other uses cases, I'll commit it
on CVS once done.

Laurent Goubet
Obeo

Gilbert Mirenque wrote:
> Hi Laurent,
> yes, you are right. There are some other places which is is in coherence
> with this. I submitted a patch under
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=308446
>
> best regards,
> Gilbert
>
>> The model roots references are only there to help people using
>> serialized differences in finding back the models that were compared ;
>> it isn't used in any other way by the EMF Compare core or UI.
>>
>> I believe your issue comes from the content provider we use to find the
>> elements that are to be displayed. Namely, I believe we only take
>> ResourceSets as input and thus your in-memory model isn't handled. I'll
>> take a look asap, but if you need to go faster, taker a look at the code
>> of ModelContentMergeDiffTabContentProvider#getElements(Object) which I
>> believe is the culprit.
>>
>> Laurent Goubet
>> Obeo
>>
>> Gilbert Mirenque wrote:
>>>> You see that if any of the models has no resource than the roots won't
>>>> be set resulting in the empty pane in the dialog. I know that I can
>>>> extend the GenericMatchEngine but I think of consistency reasons this
>>>> should be adapted?
>>> Damn...I now used a subclass of the GenericMatchEngine but without any
>>> success. The roots will be set now, but the right pane, containing the
>>> in-memory model, stays empty. The strange thing is that the differences
>>> will be marked right with thos red or green lines on the left pane. And
>>> if I select an element, which has only a different attribute value, and
>>> then open the properties tab, then on both sides the correct attribute
>>> is shown. On the left the original value and on the right the in-memory
>>> model value. But the right pane with the differences stays empty :(
>


--------------040100030101060307030502
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr">Obeo</a>
email;internet:laurent.goubet@obeo.fr
url:http://www.obeo.fr
version:2.1
end:vcard


--------------040100030101060307030502--
Previous Topic:[Announce] MoDELS 2010 Call for Papers
Next Topic:[ECP] Proposal
Goto Forum:
  


Current Time: Thu Apr 18 08:37:53 GMT 2024

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

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

Back to the top