Results 1 to 4 of 4

Thread: SpringIDE warns non-public init method, but Springs calls it

  1. #1
    Join Date
    Jan 2006
    Location
    Seattle, Washington
    Posts
    467

    Default SpringIDE warns non-public init method, but Springs calls it

    JDK 1.4.2, Spring 1.2.8, Eclipse 3.3.1.1, SpringIDE 2.0.1.

    I was looking at the warnings that Eclipse was giving me on some code, and I noticed a warning due to the SpringIDE (I assume), complaining that the method specified on an "init-method" attribute is not public.

    However, what I noticed is that Spring happily calls that private method at init time. Is this warning just a "this should probably be public, but it'll work if it's not" statement?

  2. #2
    Join Date
    Aug 2004
    Location
    Duesseldorf, Germany
    Posts
    1,210

    Default

    However, what I noticed is that Spring happily calls that private method at init time. Is this warning just a "this should probably be public, but it'll work if it's not" statement
    This is meant to be a warning of the sort you mentioned. If the init-method is not found, you'll get an error.

    Is this behavior ok for you?

    Christian
    Christian Dupuis
    SpringSource, a division of VMware
    Lead, SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/cdupuis

  3. #3
    Join Date
    Jan 2006
    Location
    Seattle, Washington
    Posts
    467

    Default

    As it is, the warning is deceptive, and probably counter-productive. It makes it seem like there's some negative impact to having the method be private, when in fact there appears to be no impact at all. If the method doesn't need to be public, then making it so makes it more available to be accessed inadvertently.

  4. #4
    Join Date
    Aug 2004
    Location
    Duesseldorf, Germany
    Posts
    1,210

    Default

    I clearly see your point here. Can you please go ahead and create a JIRA issue for this. We can then see if there is anybody with a different opinion.

    I would be happy for remove that warning.

    Christian
    Christian Dupuis
    SpringSource, a division of VMware
    Lead, SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/cdupuis

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •