#318 Properties are NULL when retrieved in Manageable constructor

closed-invalid
5
2009-07-07
2009-07-03
Anonymous
No

It appears that when using the constructor in a class that extends Manageable, the APIImpl instance isn't null, but the properties aren't parsed yet, so they are.

This implies that you can retrieve and store properties in the constructor, but you will get a NullPointerException on any method call attempt (it was a descriptor in my case).

I don't know if this is a bug or expected behaviour.

Discussion

  • Ernst de Haan

    Ernst de Haan - 2009-07-04

    Can you be a bit more specific? Which methods do you (attempt to) call from the constructor, exactly?

     
  • Anthony Goubard

    Anthony Goubard - 2009-07-07

    That's the normal behaviour.
    Manageable are created then they are bootstrap (with the bootstrap properties) and initialized (with the runtime properties).
    override bootstrapImpl and initImpl to get the values of the bootstrap or runtime properties.
    XINS functions are Manageable so you have some examples on how to do it.

     
  • Anthony Goubard

    Anthony Goubard - 2009-07-07
    • assigned_to: nobody --> agoubard
    • status: open --> closed-invalid
     
  • jborleffs

    jborleffs - 2009-07-07

    I'm retrieving the Runtime properties through the getProperties() method from the passed APIImpl instance.

    Additionally, I'm wondering why this method returns a org.xins.server.RuntimeProperties instance instead of a <package>RuntimeProperties instance, which would save a cast. But this probably should be an RFE ;-)

     
  • Nobody/Anonymous

    This is due to the fact that getProperties() extends the getProperties method of
    And until Java 5 you can override a method and change the returned class.
    since Java 5 it's possible (it's called co variant return) for sub classes.
    BTW: Is Online planning to move to Java 5 soon for the teams using XINS as moving XINS to Java 5 is one of the big upcoming features?

     
  • jborleffs

    jborleffs - 2009-07-10

    Yes, Online is. My team already uses Java 5 for all API implementations. Moving XINS to Java 5 would be a great idea!

     
  • Ernst de Haan

    Ernst de Haan - 2009-07-10

    In our PensioenPage repository we have a candidate for XINS 3.0 that is already mostly adapted for Java 5 features like generics. Although it's in constant use in production, it's not finished. It will also need discussing with Anthony on one hand, and with Online, especially for the copyright. I'd like to change the copyright from "Online" to "Online and contributors" and then list contributing companies and people in a CONTRIBUTORS text file. But let's take this discussion to the forums instead of this bug report....

     

Log in to post a comment.