Originally posted by Frans Janssen:
Steven,
Thanks for your reply. It is indeed a good suggestion to at least declare that the method throws the exception even if it doesn't. (Currently my code wasn't doing that )
However, I still like some opinions on if the assessors will accept that defined exceptions are never thrown in the implementing class.
Frans.
If your assignment is anything like the URLyBird assignment you will not have a reasonable primary key. In that case you will have no occasion where a DuplicateKeyException could possibly be thrown. You still need to declare it as a possible exception since the interface does, and you can't change the interface, but you just can't throw it. The only thing that will be concerned about this is checkstyle, and you can turn off that check.