16

Yesterday I asked this (JavaFX applications throw NullPointerExceptions but run anyway) question about an error I was encountering which didn't affect my code. The error was caught and handled outside my own code without incident, and I could only see it when in debug mode since it would suspend my stack trace.

It has since received 3 votes to close for being off-topic, but I'm not sure as to why.

Two were for:

This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers.

But the the error is reproducible and not a typographical error. The third vote was for:

Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself.

I provided a short snippet to reproduce the error, and I thought it was clear my intention was to remove the existing NullPointerExceptions.

Have users voted to close because my question isn't really a "problem", since the Exceptions never affected my code (although I guess I do have to hit "resume" 3 times to debug my project), or did I ask my question poorly (or is there some other reason I've not considered)?

5
  • 11
    I'm betting that "third" vote actually came in first, when you still had the stack traces posted as images.
    – Cody Gray Mod
    Commented Jun 23, 2017 at 14:48
  • 3
    Side note: I'm not sure how "I'm finally breaking away from Swing and trying out JavaFX" is critical to your question... Commented Jun 23, 2017 at 15:55
  • 1
    It is not clear (especially in initial version) how your code sample is related to the exception... so votes sound justified. If you'd start with "JavaFx runtime throw NPE for any sample and I'm concerned about {whatever you are concerned about}" (or something similar) you'd likely get only "missing MCVE" vote... Commented Jun 23, 2017 at 16:02
  • The linked question's really good, actually - I upvoted and favorite it because I'd like to see the answer, too. Seems like very odd behavior for production code, especially for a major framework; I'd be curious to see why it's happening. Commented Jun 23, 2017 at 21:19
  • 11
    Call me an idealist but I don't think there are "non-important errors". I've heard enough accounts along the lines of "oh yeah, ignore those errors, those are normal", but this shouldn't be a thing. Commented Jun 23, 2017 at 23:29

1 Answer 1

22

This question is on topic (now that the stack traces are posted as text) because it's a specific question about specific code. There's no requirement about how critical the exception has to be for it to be on topic. "Why does every JavaFX application I've tried (even Oracle's own code sample) throw a null pointer exception?" is a specific (and interesting) question about specific code. "Why does this code work at all?" is also a very interesting (related) question.

Incidentally, if the stack traces were still posted as images, it would be off-topic in my opinion because including them as images isn't all that much better than not including them at all, so in that case it would be perfectly valid to vote to close as "insufficient information to debug."

7
  • 1
    Your linked question asks about code, not stack traces. Many of the reasons there don't apply to stack traces.
    – jpmc26
    Commented Jun 24, 2017 at 3:55
  • 6
    @jpmc26 The same principles still apply, though, because the stack traces are essential to understanding this particular problem (so it's not really a MCVE without them). Many of the reasons you shouldn't have code as images (e.g. you can't search for it, you can't copy and paste it, it's hard to read, etc.) do apply to stack traces and error messages just as much as to code. Commented Jun 24, 2017 at 4:32
  • 2
    No, they don't. You're not going to copy/paste the error into an editor and compile it. My point is that you shouldn't drop a link that isn't discussing exactly the same thing you are without some kind of description of what you think does apply.
    – jpmc26
    Commented Jun 24, 2017 at 4:34
  • 5
    @jpmc26 That's true, but you might want to copy and paste part of the stack trace into a search engine. Besides, a lot of the other reasons (images are more difficult to read than text, they can chew through mobile data needlessly, they can't be searched for, images might be blocked by corporate proxies, images can't be interpreted by screen readers, etc.) apply equally. Commented Jun 24, 2017 at 4:37
  • 6
    @jpmc26 To quote from one of the answers, you shouldn't include code as an image "because it's completely and utterly pointless. It's wasting other people's bandwidth for something considerably less legible than the original code, which is perfectly copy/paste-able as text." You can say that just as easily about a stack trace and error message as you could about the code, especially given that the stack trace is essential to understanding what the problem is. Commented Jun 24, 2017 at 4:39
  • 2
    Note that "many of the reasons don't apply" already implied that some do. My comment was to point out a minor lack of clarity in your answer, nothing more.
    – jpmc26
    Commented Jun 24, 2017 at 4:40
  • 3
    @jpmc26 That's true. I do agree that not all of them apply, but I think that enough of them apply that it's still a really bad idea to have the stack trace be an image, especially when it's so important to understanding the problem. It's also worth noting the post I linked to was marked as a duplicate of this post, which does explicitly mention both code and error messages. Commented Jun 24, 2017 at 4:46

You must log in to answer this question.

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