Skip to main content
typo fix
Source Link
Pimgd
  • 22.3k
  • 5
  • 66
  • 144

I have to post this as an answer, as I cannot comment yet:

Do you really want to throw an IllegalStateException if you cannot extract the date? It implies that if your method ever got called with something you cannot parse or an empty string, that would be a programming error. Which, depending on how your code is used, may or may not be correct.

Also as Ia side note, I hope you're not catching that IllegalStateException in the calling code.

I have to post this as an answer, as I cannot comment yet:

Do you really want to throw an IllegalStateException if you cannot extract the date? It implies that if your method ever got called with something you cannot parse or an empty string, that would be a programming error. Which, depending on how your code is used, may or may not be correct.

Also as I side note, I hope you're not catching that IllegalStateException in the calling code.

I have to post this as an answer, as I cannot comment yet:

Do you really want to throw an IllegalStateException if you cannot extract the date? It implies that if your method ever got called with something you cannot parse or an empty string, that would be a programming error. Which, depending on how your code is used, may or may not be correct.

Also as a side note, I hope you're not catching that IllegalStateException in the calling code.

Source Link

I have to post this as an answer, as I cannot comment yet:

Do you really want to throw an IllegalStateException if you cannot extract the date? It implies that if your method ever got called with something you cannot parse or an empty string, that would be a programming error. Which, depending on how your code is used, may or may not be correct.

Also as I side note, I hope you're not catching that IllegalStateException in the calling code.