Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [henshin-user] Issue with (and fix for) EGraph.copy

Hi Steffen,

thanks! What you describe makes sense. Therefore, I have modified EGraphImpl.copy() to use your copier in case that the EGraph contains instances from Ecore: [1]

Best regards,

Am 21.09.2017 um 12:39 schrieb Steffen Zschaler:

I've been trying to run some transformations over meta-models (i.e., instances of Ecore). As part of this, I needed to copy EGraphs and used EGraph.copy. This crashed with an NPE.

I did some digging and found out that the reason is that there is an issue with how EcoreUtil.Copier works and how types and generic types are handled in Ecore. Details here: As a result, when calling EGraph.copy (null), in some cases the code can then not find copies of the EGenericType instances in the resulting map and adding them to the new graph crashes.

I have written a slightly extended version of EcoreUtil.Copier which I attach. I have so far used this like in the code below, but was wondering whether there's an interest to include this directly into Henshin instead.

// Given a graph graph1 with some Ecore instances in it
EcoreCopier copier = new EcoreCopier();

EGraph graph2 = graph1.copy(copier);

Best regards,


henshin-user mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Back to the top