6

Posted today was a question concerning throwing exceptions on numeric overflows.
Before Java 8, the solutions to checking for an overflow prior to the arithmetic were a bit obtuse, as noted by this SO post from June 2010.

On today's post there is an answer using a method from Java 8. Would it be appropriate to have that solution posted on the older thread?

Another user flagged today's post as a duplicate, citing the 2010 solutions. If that flag was accepted, I would expect the original to be updated with a 'modern' answer(s).

Edit: As pointed out to me in the comments, the 2010 post does indeed have a Java 8 answer. Additionally, the accepted answer on the duplicate has since been updated to include the Java 8 solution.

5
  • 2
    There already is an answer with the Java 8 solution on the older question: stackoverflow.com/a/26350973/3179759 Commented May 1, 2015 at 13:45
  • @Alex, I missed that one. hmm.. I suppose that answers my question, thanks!
    – CubeJockey
    Commented May 1, 2015 at 13:48
  • 1
    @Alex, the problem is that no one is going to scroll half way down the page to find the answer. Maybe the top answer could be updated with a section on Java 8 ? Commented May 1, 2015 at 14:31
  • Good point @Jonas. The top answerer is still active so I added a comment with that request. Already have +1'd the current Java8 answer.
    – CubeJockey
    Commented May 1, 2015 at 14:34
  • @Jonas Top answer has been updated.
    – CubeJockey
    Commented May 1, 2015 at 14:49

1 Answer 1

2

As Alex noted in a comment above, the 2010 post was updated in 2014 with the Java 8 solution.

That would be the answer to my question then.. yes old posts may should be updated to include more 'modern' answers.

1
  • Yes, absolutely add new modern answers to old posts. Someone searching five years from now is not going to want to click through a whole page of search results to find which question suits them. Better to have all the answers on one page.
    – Bill the Lizard Mod
    Commented May 1, 2015 at 14:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .