C#: Analyze unsafe method invokes


/ Published in: C#
Save to your folder(s)



Copy this code and paste it in your HTML
  1. class A
  2. {
  3. public static vois f()
  4. {
  5. try
  6. {
  7. ... B.DoSome(); // safe call, exceptions handled
  8. }
  9. catch(Exception e)
  10. {
  11. ...
  12. }
  13. }
  14.  
  15. public static void f2()
  16. {
  17. ... //no try-catch block
  18. B.DoSome(); // possible unhandled exception
  19. }
  20. }
  21.  
  22. class B
  23. {
  24. public static void DoSome()
  25. {
  26. ...
  27. //no try-catch block, possible to raise unhandled exception
  28.  
  29. }
  30. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.