2 Replies Latest reply on Jun 1, 2008 5:07 AM by beep_beep

    I can encounter NullPointer in that place, is it OK?

    beep_beep


      Here I check whether node exist or not

      if(node==null){
       node = rootNode.addChild(someFqn);
      }


      and here I put object into the node:
      node.put(key, obj);


      But what if eviction happened between those 2 parts of code?

      How can I defend myself agains NullPointerException?

      Please,suggest, what is best practice, excluding try/catch...?

      Thanks!
      Peter.