Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-12090

.NET: logger throws KeyNotFound on creating cache with nullable 'sbyte?' field

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.7.5
    • 2.10
    • platforms
    • Fixed .NET logging warnings for nullable signed primitives that might lead to runtime errors

    Description

       

      Logger throws KeyNotFound exception if NetToJava[type] doesn't have a type key.

      Looks like we need to replace it with NetToJava[directType].

      public static void LogIndirectMappingWarning(Type type, ILogger log, string logInfo)
       {
       if (type == null)
       return;
      var directType = GetDirectlyMappedType(type);
      if (directType == type)
       return;
      log.Warn("{0}: Type '{1}' maps to Java type '{2}' using unchecked conversion. " +
       "This may cause issues in SQL queries. " +
       "You can use '{3}' instead to achieve direct mapping.",
       logInfo, type, NetToJava[type], directType);
       }
      

       

      Steps to reproduce:

      Define a QueryEntity with a sbyte? nullable field, try to create a cache. The reproducer is attached.

       

      Attachments

        1. a.cs
          2 kB
          Denis Zakharov

        Issue Links

          Activity

            People

              ashapkin Alexandr Shapkin
              Denis Zakharov Denis Zakharov
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m