Uploaded image for project: 'Spring Modules'
  1. Spring Modules
  2. MOD-424

Usage of Class.getPackage() can cause NPE in AbstractCacheNamespaceHandler

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 0.8
    • Fix Version/s: None
    • Component/s: CACHE
    • Labels:
      None

      Description

      The AbstractCacheNamespaceHandler uses Class.getPackage() on line 77: this call can actually return null under certain circumstances and should therefore not be used. Just derive the package name from the fully qualified class name instead. Interestingly, the same bug was in several Spring Core classes as well for a long time, so you can check there for a solution too Just search for getPackage in this JIRA instance, and you'll see what I mean.
      I haven't checked for other cases, but of course if other code also depends on Class.getPackage() that should be fixed as well.

        Attachments

          Activity

            People

            Assignee:
            yatesco Colin Yates
            Reporter:
            jkuipers Joris Kuipers
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated: