Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-11306

Bad type comparison in ReflectionHelper.getTypeDifferenceWeight(List<TypeDescriptor> paramTypes, List<TypeDescriptor> argTypes)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 3.2.6, 4.0 GA
    • Fix Version/s: 3.2.7, 4.0.1
    • Component/s: Core:SpEL
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      Bad type comparison in

      ReflectionHelper.getTypeDifferenceWeight(List<TypeDescriptor> paramTypes, List<TypeDescriptor> argTypes)
      

      At line 132

      if (paramType.equals(superClass)) {
      

      This comparison will never be true since paramType class is not the same sa superClass class:

      TypeDescriptor paramType = paramTypes.get(i);
      

      and

      Class<?> superClass = argType.getClass().getSuperclass();
      

      This issue was highlighted by findbugs.

        Attachments

          Activity

            People

            Assignee:
            juergen.hoeller Juergen Hoeller
            Reporter:
            zolyfarkas Zoltan Farkas
            Last updater:
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              3 years, 37 weeks ago