Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0-RC-1
    • Fix Version/s: 1.0-RC-1
    • Component/s: PicoContainer (Java)
    • Labels:
      None
    • Number of attachments :
      0

      Description

      InterfaceFinder is a classic utility class without any state. It is not necessary to have instances of the class.

      Proposal:

      • Add a private standard ctor
      • Make all methods static
      • Remove unnecessary Serializable

      Cons:

      • avoids unnecessary object creation
      • avoids unnecessary object members (e.g. in IHCA)
      • avoids unnecessary serialization (e.g. in IHCA)

      Aslak, please assign me, if I shall do this.

        Activity

        Aslak Hellesøy made changes -
        Field Original Value New Value
        Assignee Joerg Schaible [ joehni ]
        Hide
        Aslak Hellesøy added a comment -

        I'm all for making this a class with only static methods. Also, since the class now deals with classes too, I think it should be renamed ClassHierarchyIntrospector or something.

        The testMostCommonSuperclassForJComponents runs really slowly. It would be great if you could optimise the getClass method.

        Finally, I disagree with the usage of Void.class. Void is not a superclass for anything, and IMO, Object should be used instead.

        Show
        Aslak Hellesøy added a comment - I'm all for making this a class with only static methods. Also, since the class now deals with classes too, I think it should be renamed ClassHierarchyIntrospector or something. The testMostCommonSuperclassForJComponents runs really slowly. It would be great if you could optimise the getClass method. Finally, I disagree with the usage of Void.class. Void is not a superclass for anything , and IMO, Object should be used instead.
        Hide
        Jörg Schaible added a comment -

        OK,I'll make it static.

        Concerning optimization I am not really sure, how to do so.

        The Void.class problem: I did not introduce it, it was the original behaviour. Additionally Multicaster is broken, if you return null (therefore I've added the test case). I'll keep the current behaviour for now and we can refactore this later on in a separate issue.

        Show
        Jörg Schaible added a comment - OK,I'll make it static. Concerning optimization I am not really sure, how to do so. The Void.class problem: I did not introduce it, it was the original behaviour. Additionally Multicaster is broken, if you return null (therefore I've added the test case). I'll keep the current behaviour for now and we can refactore this later on in a separate issue.
        Hide
        Jörg Schaible added a comment -

        Refactored and renamed InterfaceFinder to utility class with static-only methods. Result of Void.class for getMostCommonSuperclass still present, Multicast relies on this.

        Show
        Jörg Schaible added a comment - Refactored and renamed InterfaceFinder to utility class with static-only methods. Result of Void.class for getMostCommonSuperclass still present, Multicast relies on this.
        Jörg Schaible made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 30 minutes
              30m
              Remaining:
              Remaining Estimate - 30 minutes
              30m
              Logged:
              Time Spent - Not Specified
              Not Specified