Ok, for those who aren't in on the joke:
There is fanlore out there that suggests that John is obsessed by jam (for our American cousins, that's jelly). There is no mention of this, that I know of, in the original books nor the TV series.
The reference to Professor Dumbledore, the Head of Hogwarts School of Witchcraft and Wizardry, is from the Harry Potter series of books where Dumbledore identifies himself to Harry by saying that his favourite jam is raspberry. This is due to guidelines by the Ministry of Magic to ensure that people are who they say they are and not Death Eaters in disguise. Dumbledore wisely points out that if he were a Death Eater in disguise then he'd have done his research and known that anyway, so proving that it is indeed Dumbledore by showing his quirky sense of humour.
Sherlock half listens to his flatmate and vaguely remembers him mentioning raspberry jam being a favourite. Bless him, he tries hard.
