|
From: <mcu...@us...> - 2015-01-02 06:08:29
|
Revision: 1557
http://sourceforge.net/p/orm/code/1557
Author: mcurland
Date: 2015-01-02 06:08:27 +0000 (Fri, 02 Jan 2015)
Log Message:
-----------
Changes in [1556] incorrectly removed required variable quantification for uncorrelated path roots introduced in the middle of a derivation rule.
Modified Paths:
--------------
trunk/ORMModel/ObjectModel/Verbalization.cs
Modified: trunk/ORMModel/ObjectModel/Verbalization.cs
===================================================================
--- trunk/ORMModel/ObjectModel/Verbalization.cs 2014-12-31 03:54:52 UTC (rev 1556)
+++ trunk/ORMModel/ObjectModel/Verbalization.cs 2015-01-02 06:08:27 UTC (rev 1557)
@@ -9692,7 +9692,7 @@
/// with. The list of correlated variables is stored with the normalized root correlation
/// variable. This may be the same instance as <paramref name="usedFor"/> and should not
/// be pre-normalized before this call.</param>
- /// <param name="variableAlreadyScoped">The returned variable was in used and scoped before this call.</param>
+ /// <param name="variableAlreadyScoped">The returned variable was in use and scoped before this call.</param>
/// <returns>New or existing variable</returns>
private RolePlayerVariable RegisterRolePlayerUse(ObjectType rolePlayer, RolePlayerVariable joinToVariable, object usedFor, RolePathNode correlateWithNode, out bool variableAlreadyScoped)
{
@@ -9702,6 +9702,7 @@
RolePlayerVariableUse correlationRootVariableUse = default(RolePlayerVariableUse);
object correlateWith = null;
variableAlreadyScoped = false;
+ bool lockVariableAlreadyScoped = false;
if (!correlateWithNode.IsEmpty &&
null != (correlateWith = EnsureRolePathCache().GetCorrelationRoot(correlateWithNode)))
{
@@ -9809,7 +9810,8 @@
// Note that if joinToVariable is set here, then it comes from an external
// correlation. Otherwise, the join would have the same correlation root
// as the current pathed role.
- RegisterRolePlayerUse(correlationRootRolePlayer, joinToVariable, correlateWithKey, RolePathNode.Empty);
+ RegisterRolePlayerUse(correlationRootRolePlayer, joinToVariable, correlateWithKey, RolePathNode.Empty, out variableAlreadyScoped);
+ lockVariableAlreadyScoped = true;
correlationRootVariableUse = useMap[correlateWithKey];
if (correlationRootRolePlayer == rolePlayer)
{
@@ -9891,7 +9893,7 @@
}
// Track use phase during registration to see if the root variable is
// referenced by the path.
- if (!UseVariable(existingVariable, myLatestUsePhase, false))
+ if (!UseVariable(existingVariable, myLatestUsePhase, false) && !lockVariableAlreadyScoped)
{
variableAlreadyScoped = true;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|