Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [henshin-dev] Unexpected getAction() behavior

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I attached a patch for the behavior that reflects the behavior I would
have expected, including the correction for the comment.

On 09/02/2014 01:51 PM, Sebastian Gabmeyer wrote:
> Hi!
> 
> I stumbled over some unexpected behavior, well at least from my 
> perspective ;) Here are the details: I'm iterating over the nodes
> of the RHS graph and would like to check whether the node is
> preserved or created. So I call the GenericActionHelper.getAction()
> method which - unfortunately - returns null if the node is
> preserved. Is this behavior intended or is it a bug?
> 
> BTW, the comment in line 97 of GenericActionHelper in method 
> getAction() should probably read
> 
> // If it doesn't have an origin in the LHS, it is a CREATE-action:
> 
> instead of
> 
> // If it has an origin in the LHS, it is a CREATE-action:
> 
> Best regards, Sebastian 
> _______________________________________________ henshin-dev mailing
> list henshin-dev@xxxxxxxxxxx To change your delivery options,
> retrieve your password, or unsubscribe from this list, visit 
> https://dev.eclipse.org/mailman/listinfo/henshin-dev
> 

- -- 
Sebastian Gabmeyer
Business Informatics Group (BIG)
Vienna University of Technology

http://www.big.tuwien.ac.at/staff/sgabmeyer
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJUBbJUAAoJELSN8YoN2kNZ3nQIAJWTCrwBOEJfk4iGl/OYiBVR
wir46kMdzcZ1S3BuY+LjtnoiDtlP2UU+PRZj/yCly2FgvB6eB8EV42jAJzIQbJ1A
RzJJY2uoi0YVNxM4BM5Ht4HgrA5zPI70Q3fF7G270DHHS/ob1nVt2GzhFx5gafpa
DqMgaU7XtKVOYhKoCYyu/jhqvYIy3/nxvh18k+5Fd9tCaOMnxm6dQdmFoxMRW8YC
+U/n/I5gwLUMX9uC1JCsKgHFNXLGFdm0jLKgMBdOwV2b09K+dQ/H8Bv8S2JF37v5
poORnwcEpK55qvO7bbWNT/l5aTzLOMVsa7+azOsju8fjx16ht9+7AWA/qZzvj0Y=
=glAf
-----END PGP SIGNATURE-----
diff --git a/plugins/org.eclipse.emf.henshin.model/src/org/eclipse/emf/henshin/model/actions/GenericActionHelper.java b/plugins/org.eclipse.emf.henshin.model/src/org/eclipse/emf/henshin/model/actions/GenericActionHelper.java
index 2da4fa8..a1cb9d5 100644
--- a/plugins/org.eclipse.emf.henshin.model/src/org/eclipse/emf/henshin/model/actions/GenericActionHelper.java
+++ b/plugins/org.eclipse.emf.henshin.model/src/org/eclipse/emf/henshin/model/actions/GenericActionHelper.java
@@ -94,9 +94,11 @@
 			editor = getMapEditor(rule.getRhs());
 			E origin = editor.getOpposite(element);
 			
-			// If it has an origin in the LHS, it is a CREATE-action:
+			// If it doesn't have an origin in the LHS, it is a CREATE-action:
 			if (origin==null) {
 				return new Action(CREATE, isMulti, multiPath);
+			} else {
+			  return new Action(PRESERVE, isMulti, multiPath);
 			}
 		}
 		

Back to the top