commit | 7d52da857cd304126d786bcda58dd0ed196db236 | [log] [tgz] |
---|---|---|
author | Johannes Faltermeier <jfaltermeier@eclipsesource.com> | Fri Apr 07 16:13:50 2017 +0200 |
committer | Johannes Faltermeier <jfaltermeier@eclipsesource.com> | Fri Apr 07 16:14:03 2017 +0200 |
tree | 908a1b799ac21947e4a4e6777e2aa614fd8f0629 | |
parent | 004fba5faf5a8062eaea8e81eb478b7b51f48f7c [diff] |
Bug 499000 - BasicIndexOutOfBoundsException below CommandStackListener.getHistory * Make sure that history resource actually contains a history Change-Id: I83c68e8f51730298a1641bf5ce832b19c95341a3 Signed-off-by: Johannes Faltermeier <jfaltermeier@eclipsesource.com>
diff --git a/plugins/org.eclipse.emf.edapt.history.edit/src/org/eclipse/emf/edapt/history/recorder/EditingDomainListener.java b/plugins/org.eclipse.emf.edapt.history.edit/src/org/eclipse/emf/edapt/history/recorder/EditingDomainListener.java index cee0971..efeec28 100644 --- a/plugins/org.eclipse.emf.edapt.history.edit/src/org/eclipse/emf/edapt/history/recorder/EditingDomainListener.java +++ b/plugins/org.eclipse.emf.edapt.history.edit/src/org/eclipse/emf/edapt/history/recorder/EditingDomainListener.java
@@ -135,6 +135,12 @@ try { historyResource.load(null); EcoreUtil.resolveAll(historyResource); + if (historyResource.getContents().isEmpty()) { + return false; + } + if (!History.class.isInstance(historyResource.getContents().get(0))) { + return false; + } return true; } catch (final IOException e) { resourceSet.getResources().remove(historyResource);