1 2 Previous Next 19 Replies Latest reply: May 23, 2012 5:17 PM by EJP Go to original post RSS
      • 15. Re: try in a method
        Tshifhiwa
        Moderator action: deleted your request. This is a public user to user forum. Questions and answers should be posted here,* not taken offline. You have already abused the patience of forum members by posting yards of unformatted code and several unreasonable questions.

        Edited by: EJP on 16/05/2012 22:28
        • 16. Re: try in a method
          796440
          Tshifhiwa wrote:
          can i send you my application
          No, and there's no need. These are the ways to deal with NPE:

          1) If it's occurring in your code, fix the bug in your code. This means checking for null, or ensuring that you never even get to that point with the reference being null.

          2) If it's occurring in code you don't control due to a bug in that code, then you either stop using that library, or you ensure you don't feed it the dangerous null, or, as a very, very last resort, you catch the exception.

          3) If it's occurring in code you don't control due to you feeding it bad input, don't feed it that null input.
          • 17. Re: try in a method
            Tshifhiwa
            i have to return my parameter
            • 18. Re: try in a method
              796440
              Tshifhiwa wrote:
              i have to return my parameter
              Yes? So?

              How does that relate to anything discussed so far?

              And what do you mean by "return my parameter"? Is it this?
              void foo(Bar bar) {
                return bar;
              }
              • 19. Re: try in a method
                EJP
                Tshifhiwa wrote:
                i have to return my parameter
                Moderator action: Enough meaningless questions is enough. I am now locking this futile thread.
                1 2 Previous Next