Bug 522535 - ObservablePatternMatch(List|Set).dispose leaves RuleEngine in disposed state
Summary: ObservablePatternMatch(List|Set).dispose leaves RuleEngine in disposed state
Status: RESOLVED FIXED
Alias: None
Product: Viatra
Classification: Modeling
Component: Addons (show other bugs)
Version: 1.6.1   Edit
Hardware: Macintosh Mac OS X
: P3 normal
Target Milestone: 1.7.0M3   Edit
Assignee: Abel Hegedus CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-20 09:29 EDT by Denes Harmath CLA
Modified: 2017-09-25 05:19 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Denes Harmath CLA 2017-09-20 09:29:33 EDT
After disposing and recreating an observable match set or list:

IObservableSet observableSet = ViatraObservables.observeMatchesAsSet(FooMatcher.on(engine));
observableSet.dispose();
observableSet = ViatraObservables.observeMatchesAsSet(FooMatcher.on(engine));

the newly created instance will reuse the disposed RuleEngine of the disposed observable set, therefore firings and hence match set changes will not occur.
This is because
org.eclipse.viatra.addon.databinding.runtime.collection.ObservableCollectionHelper.getRuleEngine(ViatraQueryEngine) returns the old RuleEngine instance. Disposing the RuleEngine should remove it from the ObservableCollectionHelper.queryToRuleEngineMap cache.
Comment 1 Eclipse Genie CLA 2017-09-22 11:45:35 EDT
New Gerrit change created: https://git.eclipse.org/r/105632
Comment 3 Abel Hegedus CLA 2017-09-25 05:19:01 EDT
Fixed in master.