2

Recently I came across a question that was closed as a duplicate. The duplicate answer that was linked was out of date, and now incorrect. The question that was closed had a highly voted answer, which was correct.

The user who closed the question defended their behavior. My question is, is it OK to close questions as duplicates when you know the duplicate in question is now answered incorrectly? Doesn't that just mislead anyone who finds either question?

For anyone who is curious, here is the question:

https://stackoverflow.com/questions/40623596/shortcut-in-using-or-operator-multiple-times-to-compare-values-in-a-state

12
  • I know nothing about Java and just read the question out of curiousity, but I have to say that I can understand why the question is marked as duplicate. The question never mentions the version of java, so the original answers can still be correct. If the poster would've asked for a Java 8+ solution or mentioned that other answers are incorrect then you could argue that it is not a duplicate. But I wonder, with four years of difference in technique isn't it fair to assume that poster means the current version? And since the question provides a whole new answer, doesn't that justify it?
    – user4864425
    Commented Nov 16, 2016 at 10:32
  • 2
    Why are the linked answers incorrect? A Java update does not render any answer incorrect -- Java is backwards compatible so whatever worked before, has very very good chance to work with the latest version. It might become obsolete, but that is definitely not the same as incorrect. There is already an established practice regarding obselete answers, which is to post a new answer, with the new information. This is what should be done here.
    – Tunaki
    Commented Nov 16, 2016 at 14:53
  • 1
    But how do you get someone to post a new answer if you are unable to ask the question? Because why would someone answer a four year old question that already has answers? I've read the comments of JohnFitzpatrick and Soren in the link from Tunaki where this issue is addressed. A bounty is rather expensive and for some not possible because they may not have enough reputation points. Leaving them no choice but to repeat the question. Perhaps there should be an option to mark a question as 'looking for an updated answer'.
    – user4864425
    Commented Nov 16, 2016 at 16:24
  • 1
    @Tunaki Did you read the answer? It says what OP is asking for is impossible, which is now wrong.
    – nhouser9
    Commented Nov 16, 2016 at 18:09
  • 2
    @nhouser9 Which answer are you talking about? I see one that says there is no construct to do (a||b) == 0 as shorcut for a==0 || b == 0, which is what the OP of the question wanted to do, and that is correct; this construct does not exist. It doesn't say the thing is impossible to do, just that the syntax the OP wanted to have doesn't exist (and still doesn't). The rest of the answer suggest to factor this into a method and doesn't provide a good alternative way to do it, that's true. The other answers do provide alternatives though (there is more than just the accepted answer).
    – Tunaki
    Commented Nov 16, 2016 at 18:13
  • 1
    @Tunaki The question is "But is there a more concise format to do this? Possibly similar to this" and the answer is "Unfortunately there is no such construct in Java.". The question asks for any more concise way to check a list of variables against one value. The answer says no such construct exists. Such a construct DOES exist now. The answer is outdated and wrong, and by linking a duplicate to it, we are directing even more traffic to a wrong answer.
    – nhouser9
    Commented Nov 16, 2016 at 20:42
  • You're getting stuck on there is no such construct as being an answer to is there a shortcut to evaluating multiple conditions. It's not. It's an answer specifically to is there a (a||b) syntax. You have to read between the lines. Both these questions are asking for shortcuts to comparing a value against multiple others. That's what makes them duplicates. Commented Nov 16, 2016 at 21:05
  • 1
    @SotiriosDelimanolis I never disagreed that they were duplicates. I disagreed that its healthy for the site to point people to a duplicate that has a wrong answer.
    – nhouser9
    Commented Nov 16, 2016 at 22:02
  • Again, there's nothing wrong about that answer. That first sentence is specifically addressing the absence of a proposed syntax. If we can't convince you of that, then too bad. Vote to reopen, downvote, open meta questions, do your thing. Commented Nov 16, 2016 at 22:08
  • 1
    @SotiriosDelimanolis So just to be clear, you think it is good for StackOverflow that people searching for this answer will be directed to an answer that says it can't be done? Can you please clarify how directing people to a wrong answer helps this site?
    – nhouser9
    Commented Nov 16, 2016 at 22:32
  • Last time, I disagree that this is a wrong answer. My opinion is that you're misreading it. Commented Nov 16, 2016 at 22:40
  • 1
    @SotiriosDelimanolis The question is "is there a shortcut for using || multiple times to compare to the same value" and the answer is "there is no such construct in java", for the other question the answer is "is there a simpler way to check multiple values against one value" and the answer is "there is no such construct". The question is clearly worded. The answer is also clearly worded. It is 100% clear. Is there a simpler way? No, there isn't. Which is wrong.
    – nhouser9
    Commented Nov 17, 2016 at 0:23

1 Answer 1

6

Looks like this answer should be moved over to the more canonical question instead. The answer isn't incorrect necessarily, considering that there are still shops not on Java 8, but a newer approach/method has been discovered in a newer version, which would suffice as its own answer.

I have a gold badge in Java, but I agree with the closure; I'd want to follow this up with a request to merge this answer into the canonical one.

You must log in to answer this question.

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