PicoContainer
  1. PicoContainer
  2. PICO-109

NullPointerException in BeanComponentAdapter

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0-beta-4
    • Fix Version/s: 1.0-beta-5
    • Component/s: PicoContainer (Java)
    • Labels:
      None
    • Number of attachments :
      2

      Description

      If a bean has a dependency to a non registered component or an attribute that is not a component, a NullPointerException is thrown.

      I have added a String attribute in the A inner class of the BeanComponentAdapterTestCase to show this issue.

      Attached you find the enhanced TestCase and a patch for the BeanComponentAdapter class. (I've no CVS access so I can't make a real path as descriped in the documentation)

      Mirko

      1. BeanComponentAdapter.java
        4 kB
        Mirko Novakovic
      2. BeanComponentAdapterTestCase.java
        1 kB
        Mirko Novakovic

        Activity

        Hide
        Mirko Novakovic added a comment -

        The patched BeanComponentAdapter class.

        Show
        Mirko Novakovic added a comment - The patched BeanComponentAdapter class.
        Mirko Novakovic made changes -
        Field Original Value New Value
        Attachment BeanComponentAdapter.java [ 11290 ]
        Hide
        Mirko Novakovic added a comment -

        The enhanced test case.

        Show
        Mirko Novakovic added a comment - The enhanced test case.
        Mirko Novakovic made changes -
        Attachment BeanComponentAdapterTestCase.java [ 11291 ]
        Hide
        Aslak Hellesøy added a comment -

        Please use regular unified diff (between a clean checkout and your modified sources in another folder) and atttach that.

        Show
        Aslak Hellesøy added a comment - Please use regular unified diff (between a clean checkout and your modified sources in another folder) and atttach that.
        Hide
        Mirko Novakovic added a comment -

        Aslak,

        please help me with that. As I said, I've no CVS access (firewall) and I am using Windows. I am using WinMerge for diffs, but I can't see that it can export the differences to a "unified file"...
        Any ideas how to make such a file?

        I've made some more fixes and would like to post them. As I am working on beta-4 source, I've seen that some major changes have been made in the current HEAD (if I download the tarball) e.g. the BeanPropertyComponentAdapterFactory has been moved from extras to default package. I've changed this class a lot and now diff does not work because the files are in different directories...

        Thank you.
        Mirko

        Show
        Mirko Novakovic added a comment - Aslak, please help me with that. As I said, I've no CVS access (firewall) and I am using Windows. I am using WinMerge for diffs, but I can't see that it can export the differences to a "unified file"... Any ideas how to make such a file? I've made some more fixes and would like to post them. As I am working on beta-4 source, I've seen that some major changes have been made in the current HEAD (if I download the tarball) e.g. the BeanPropertyComponentAdapterFactory has been moved from extras to default package. I've changed this class a lot and now diff does not work because the files are in different directories... Thank you. Mirko
        Hide
        Aslak Hellesøy added a comment -

        Fixed, with modifications. Unsatisfied dependencies in setter methods will now throw UnsatisfiableDependenciesException.

        Show
        Aslak Hellesøy added a comment - Fixed, with modifications. Unsatisfied dependencies in setter methods will now throw UnsatisfiableDependenciesException.
        Aslak Hellesøy made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Fix Version/s 1.0-beta-5 [ 10145 ]
        Resolution Fixed [ 1 ]
        Assignee Aslak Hellesoy [ rinkrank ]

          People

          • Assignee:
            Aslak Hellesøy
            Reporter:
            Mirko Novakovic
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: