typeAlias does not work for generics with 2 or more generic parameters
----------------------------------------------------------------------

                 Key: IBATISNET-234
                 URL: https://issues.apache.org/jira/browse/IBATISNET-234
             Project: iBatis for .NET
          Issue Type: Bug
          Components: DataMapper
    Affects Versions: DataMapper 1.6.1
         Environment: .Net 2
            Reporter: Roaan Vos
            Priority: Minor


The typeresolver does not work with generic types that takes 2 (or more) 
generic parameters.
The problem lies in the "SplitTypeAndAssemblyNames" method of the 
"TypeAssemblyInfo" class.

The follow is a fix

================ CUT ==========================
            private void SplitTypeAndAssemblyNames(string originalTypeName)
            {
                if (originalTypeName.StartsWith(TypeAssemblyInfo.NULLABLE_TYPE))
                {
                    int typeAssemblyIndex = 
originalTypeName.LastIndexOf(TypeAssemblyInfo.NULLABLE_TYPE_ASSEMBLY_SEPARATOR);
                    if (typeAssemblyIndex < 0)
                    {
                        _unresolvedTypeName = originalTypeName;
                    }
                    else
                    {
                        _unresolvedTypeName = originalTypeName.Substring(0, 
typeAssemblyIndex + 2).Trim();
                        _unresolvedAssemblyName = 
originalTypeName.Substring(typeAssemblyIndex + 3).Trim();
                    }
                }
                else
                {
                    int typeAssemblyIndex = 
originalTypeName.LastIndexOf(TYPE_ASSEMBLY_SEPARATOR);
                    if (typeAssemblyIndex < 0)
                    {
                        _unresolvedTypeName = originalTypeName;
                    }
                    else
                    {
                        _unresolvedTypeName = originalTypeName.Substring(0, 
typeAssemblyIndex).Trim();
                        _unresolvedAssemblyName = 
originalTypeName.Substring(typeAssemblyIndex + 1).Trim();
                    }
                }
            }
======================= CUT =========================

Note that I changed the ".IndexOf(TYPE_ASSEMBLY_SEPARATOR)" to
".LastIndexOf(TYPE_ASSEMBLY_SEPARATOR)"

Not a brilliant fix, but I think it will do

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to