26

I was looking to check what is the default value for a boolean in Java. This was asked several times:

Both of those are closed as a duplicate of:

Why is Java's default value for Boolean set to true?

The second one shows two duplicate targets, one of them being the first question.

The choice of the duplicate target doesn't seem good to me. The question is confusing, it starts with some assumption which is not true, and it does not show the specific code.

The questions asks:

Why does private Boolean shouldDropTables; assign true by default to the variable instead of NULL

... which it does not, unless there is some more code. The OP even does not tell why he/she thinks the value is true. Perhaps he has seen it in the debugger. Perhaps it has failed a test shouldDropTables == false ... how can one guess?

When seeing this, I would immediately close it as "Questions seeking debugging help ("why isn't this code working?") ..."

I think a question simple and basic like this (default Boolean value in Java) would deserve a good canonical answer.

How can this be fixed? I could vote to close the current duplicate target and to reopen the questions linking to it, once reopened the vote to close one of them as a dupe of the other, but I am not sure if this is a right way to proceed.

1
  • 9
    I've voted to reopen the first one. It has 315k views while the target has 15k views. It clearly has a better title/wording for a canonical question.
    – user2285236
    Commented Jul 3, 2018 at 10:40

2 Answers 2

18

Since I hold a gold badge in Java, I changed the dupes around (and edited the "canonical").

Since the canonical answers both questions sufficiently, I simply closed the other as a dupe of it and removed the multiple entries on the dupe list so that it reads less confusingly.

6
  • I edited the canonical so it asks about boolean in addition to Boolean. There were only 2 answers which did not already mention the default value of boolean. (One of the answers even gave the default value of boolean instead of Boolean.) Anyway, it's more unified now.
    – Radiodef
    Commented Jul 3, 2018 at 21:54
  • @Radiodef: It really didn't need that...
    – Makoto
    Commented Jul 3, 2018 at 21:59
  • 2
    There are some people complaining in the comments for this Q&A that the duplicate is "only about Boolean", despite answering for both.
    – Radiodef
    Commented Jul 3, 2018 at 22:08
  • 1
    The comments could be wiped clean by a moderator since they're serving as noise now.
    – Makoto
    Commented Jul 3, 2018 at 22:11
  • 3
    should stackoverflow.com/questions/6048313/… actually be closed as "cannot reproduce" instead of duplicate. There's no way for any of us to reproduce that the way OP has it, since there is no information. Don't really understand 36 upvotes on it...
    – eis
    Commented Jul 4, 2018 at 20:00
  • TIL some languages made a new word called lowercase boolean... great... there should be only one Boolean, the capitalized one...
    – TylerH
    Commented Jul 5, 2018 at 14:26
3

An incorrect assumption can still be a good question.

That dupe target certainly isn't a "Questions seeking debugging help ("why isn't this code working?") ...". It has 2 similar but different code snippets that have 2 different outcomes that the OP would like to have explained. That seems perfectly valid to me.

Either way,

Gold badge owners can edit the "duplicate of" list of a question. If a dupe target needs to be changed, editing it is quite a lot easier than re-opening and closing.

8
  • What I find confusing is none of the snippets included in the questions shows behaviour OP is asking about, namely Boolean set to true.
    – Suma
    Commented Jul 3, 2018 at 8:28
  • If gold hammer owners can do it, what would be the proper way to notify them considering it? Raising this meta topic, commenting on the question, or something else?
    – Suma
    Commented Jul 3, 2018 at 8:32
  • 2
    The easiest way would be to poke someone on chat, but that's not always appreciated. You could comment mentioning the better dupe target, and if a user with a gold hammer sees it, they could edit the list.
    – Cerbrus
    Commented Jul 3, 2018 at 8:34
  • 1
    That dupe target certainly isn't a Questions seeking debugging help ("why isn't this code working?") ... Why do you think it isn't? He is asking why something is the way it is, which its not... For it to be that we would need more context.... The answers are great but the question itself is bad
    – EpicKip
    Commented Jul 3, 2018 at 11:11
  • @EpicKip: it’s asking for an explanation about how the language works. It’s not debugging an application.
    – Cerbrus
    Commented Jul 3, 2018 at 11:13
  • 1
    @Cerbrus But its asking why something works like it does, he may think its the language but its his code. Does it matter if the asker knows if he's actually debugging his code?
    – EpicKip
    Commented Jul 3, 2018 at 11:14
  • @EpicKip: I'm just saying I don't think that it's a valid close reason here.
    – Cerbrus
    Commented Jul 3, 2018 at 11:16
  • @Cerbrus I understand, I was just asking to get your input ^^
    – EpicKip
    Commented Jul 3, 2018 at 11:17

You must log in to answer this question.

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