PicoContainer
  1. PicoContainer
  2. PICO-234

Invalid Parameters does not allow VerifyingVisitor to traverse Pico

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.2
    • Component/s: PicoContainer (Java)
    • Labels:
      None
    • Environment:
      JDK 1.5, WinXP
    • Testcase included:
      yes
    • Number of attachments :
      0

      Description

      Below is a blatant disregard of PicoContainer APIs. However, Visiting doesn't allow you to uncover the real culprit because an NPE is thrown. I'd really like to see it 'fixed' enough so taht VerifyingVisitor can catch the error and thereby print out something useful instead.

      (Note, this NPE will occur on any visitor, not just a VerifyingVisitor)

      public void testBlowUpPicoVisitorWithNullParameter() throws NullPointerException {
      MutablePicoContainer picoToMuckWith = new DefaultPicoContainer();
      picoToMuckWith.registerComponent(new ConstructorInjectionComponentAdapter(ArrayList.class, ArrayList.class,
      new Parameter[3]));

      VerifyingVisitor vv = new VerifyingVisitor();

      //Will throw NPE when visiting the component adapter.
      vv.traverse(picoToMuckWith);
      }

      Thanks!
      -Mike (R)

        Activity

        Jörg Schaible made changes -
        Field Original Value New Value
        Assignee Joerg Schaible [ joehni ]
        Jörg Schaible made changes -
        Fix Version/s 1.3 [ 11331 ]
        Jörg Schaible made changes -
        Fix Version/s 1.2 [ 11330 ]
        Fix Version/s 1.3 [ 11331 ]
        Hide
        Jörg Schaible added a comment -

        We follow the fail-fast rule. Therefore is now a NPE thrown creating the CA.

        Show
        Jörg Schaible added a comment - We follow the fail-fast rule. Therefore is now a NPE thrown creating the CA.
        Jörg Schaible made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Jörg Schaible
            Reporter:
            Michael Rimov
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: