Try-catch: is this acceptable practice?

前端 未结 8 2138
终归单人心
终归单人心 2020-12-17 17:35

We have received Java code from a software supplier. It contains a lot of try-catch blocks with nothing in the catch part. They\'re all over the pl

8条回答
  •  太阳男子
    2020-12-17 18:27

    What did your contract with the supplier specify? If what they wrote, bad practice and all, meets the spec then they will charge you for a rewrite.

    Better to specify a set of tests that will enter many or all of those try-catch blocks and hence fail. If the tests fail you have a better argument to make them fix their terrible code.

提交回复
热议问题