facebook

Disabling default constructor generates warning message

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #281795 Reply

    desikage
    Member

    I have the following code:

        /**
         * disable default constructor
         */
        private BrewerCode() {
        }

    Eclipse then generates “The constructor BrewerCode() is never used locally” Warning.

    How do I turn this off but at the same time not turn it off for valid “never used locally” warnings??

    Thanks for any advice!

    #281806 Reply

    Loyal Water
    Member

    desikage,
    Im sorry but you cannot disable selected warning. You will have to disable all the warnings. If you don’t want to use the constructor, you might as well delete it.

    #281812 Reply

    desikage
    Member

    If you don’t want to use the constructor, you might as well delete it.

    Well the constructor is being used to override the default constructor. We want to disable someone from being able to instantiate an object using the no-arg constructor. Is there a way to do this and avoid the warning message?

    #281832 Reply

    Loyal Water
    Member

    Im sorry this warning cannot be turned off.

    #283137 Reply

    Mark Barton
    Member

    This message has not been recovered.

    #283144 Reply

    Loyal Water
    Member

    This message has not been recovered.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Disabling default constructor generates warning message

You must be logged in to post in the forum log in