-4

I came across this question in a review queue and I voted to close it as too broad... Failed audit.

How does this compile?

Now, the question is +18 / -2 without me, so I get why it was included as a presumably automatically picked audit.

My problems with it were:

  • Albeit one block of code, it seems to ask 3 distinct questions, which should point to 3 (or at least 2) areas of concern. So too broad.
  • It doesn't appear to provide a minimal example for each of the aforementioned problems.
  • It doesn't mention which IDE is being used. So not verifiable.

Other issues which possibly do not merit closure:

  • The title is broad enough to be pretty much useless.
  • The problem description itself is so localized that it will be impossible for users with the same problem to find.
  • The answers either cannot replicate the problem, possibly indicating the issue is not verifiable, or propose alternatives without addressing the reason behind the problem.

Note: I've been review-banned because of this (until 2021!), but this is not the topic of the question. I'd like to focus on this particular question to get some insight on why I got it wrong. So... in 2021... I have a better chance of getting things right!

7
  • 2
    I thought that questions with down-votes weren't able to be chosen as audits.
    – yivi
    Commented Oct 17, 2018 at 17:24
  • 2
    eh, i think it's less good and more interesting. the comment on the question seems to indicate as much
    – Kevin B
    Commented Oct 17, 2018 at 17:24
  • Merits of this particular audit aside, you'd need to have a long history of bad reviews to get a review-ban that long.
    – Nissa
    Commented Oct 17, 2018 at 17:29
  • 5
    @StephenLeppik, I have a long history of disputing audits. The ban-timer keeps doubling despite a ban being overturned, so in fact my last "real" failure may have been months ago, e.g. see this meta, reviewed this as no mcve, reviewed this as fine, deleted due to plagiarism, though different. All 3 were overturned.
    – jpp
    Commented Oct 17, 2018 at 17:40
  • 3
    @StephenLeppik, All that said, I'm not here to dispute the ban, just confused about this question which, to me, has zero future value given the way it's written.
    – jpp
    Commented Oct 17, 2018 at 17:43
  • 1
    It is by far the most powerful feature of SO. It is excellent at bumping programmers out of their comfort-zone, ingrained by doing stuff for too long the same way. Commented Oct 17, 2018 at 23:15
  • 3
    @yivi I was under that impression as well... that even one downvote would remove it from the audit pool as a "known good question". Maybe there's something at play here to counter that, or SO has changed their metrics.
    – TylerH
    Commented Oct 19, 2018 at 19:42

1 Answer 1

18

I'm the commentator on that question. I have a gold badge in Java and I work in the language daily.

I also happen to live here on Meta, but that's beside the point.

I'll address your concerns in sequence.

Albeit one block of code, it seems to ask 3 distinct questions, which should point to 3 (or at least 2) areas of concern. So too broad.

The question is asking one question. The three points being brought up relate to one another explicitly, and they all center around Java's generics, which are known to be strange exotic broken compared to other languages.

It doesn't appear to provide a minimal example for each of the aforementioned problems.

I was able to import this question's code into my IDE and observe the aforementioned problem. So this met the minimal example requirement.

It doesn't mention which IDE is being used. So not verifiable.

This is immaterial; IDEs delegate to javac for compilation anyway, and if the code doesn't compile, then the IDE has little to do with it. The IDE is likely providing warnings or other useful information for the engineer, though.

As to the gist of the question - this isn't too broad by a long shot. This is a very specific and very narrow instance of generics being applied in a way that makes most developer's heads spin, and even caused the compiler to choke when doing the "intuitive" thing. Not knowing why this code isn't working is a question which is fairly on-topic here, but it has to meet an ever moving standard of topicality, which I strongly believe it has.

No reason to close it since it's very specific, very narrow and has a good answer to it. Others applying streams and generics in Java will benefit from this knowledge.

12
  • 4
    Sure, you're the java expert. How would you suggest someone find this question if they have the same problem? Should one need to browse all Q&A tagged generics + java?
    – jpp
    Commented Oct 17, 2018 at 17:55
  • 5
    If you have a better title, that'd be a good start. I can't think of one since titles like this are tough, but then again, I'm not entirely bothered with reworking the title since the question and answer definitely did benefit the OP in this context.
    – Makoto
    Commented Oct 17, 2018 at 17:56
  • 1
    That's unfortunate. I'm not a gold-badge holder in java so I'm not going to try. Maybe I have a different standard/purpose, but the questions I answer either have a reasonable title + problem statement, or I edit so they have some use beyond helping OP. And, if they don't, I got it wrong and get downvotes / close-votes / deletions.
    – jpp
    Commented Oct 17, 2018 at 18:02
  • 6
    I have a gold badge in Java too, and I voted to close as too broad. Also note that the actual question is "how does this compile" while the points of confusion are actually about why some other code which wasn't posted doesn't compile (which is not really something that can be fixed by editing the actual question). 2 of the questions are answered by "It works for me", which is another reason to vote to close it. Commented Oct 17, 2018 at 18:07
  • 4
    @Dukeling: I fundamentally disagree with this premise. Your purported "works for me" answer doesn't elaborate how with any minimally modified code examples. Also, it feels like that response moves the goalposts for what is an acceptable question in this category. People ask questions about why their code doesn't work all the time here. Of the examples we receive, this is the least terrible of them all.
    – Makoto
    Commented Oct 17, 2018 at 19:12
  • @Makoto Questions about code that doesn't work are expected to actually contain the code that doesn't work. Maybe the question would've been better had they simply asked how to do it. Commented Oct 17, 2018 at 19:16
  • @Dukeling: And the question does...? I'm not sure I follow. The OP does describe what's going on with their question succinctly. Their code as posted would compile, but if they attempt to remove the map, their code won't compile. I'm really not sure what the hangup is here.
    – Makoto
    Commented Oct 17, 2018 at 19:19
  • With respect to the title, what about something along the lines of "How does this Function-implementing class compile"?
    – duplode
    Commented Oct 18, 2018 at 2:22
  • @duplode, Your attempt justifies the problem with the question.. It's broad enough to defy any attempt! And, as it happens, the answers (however useful) mostly answer a different question.
    – jpp
    Commented Oct 18, 2018 at 8:39
  • 6
    @jpp I feel the question is fine, and agree with Makoto's case here. One way of paraphrasing it might be: "I have this small, self-contained piece of code, and I had to do these strange things to satisfy the typechecker. Why were those contortions needed?" That we are having trouble to come up with a good title is unfortunate, but on its own it's no reason for closing it. As for answering a different question, XY questions are not off-topic.
    – duplode
    Commented Oct 18, 2018 at 13:13
  • The IDE and exact compiler version can matter with Java. There are compiler bugs and there are different compilers. I've run into problems with Eclipse compiler that were fine by the Java language specification itself... Commented Oct 25, 2018 at 7:34
  • @AnttiHaapala: The Eclipse compiler isn't official or supported in a Java context. Eclipse is doing its own thing with the compiler which is well off the beaten path.
    – Makoto
    Commented Oct 25, 2018 at 14:41

You must log in to answer this question.

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